Updated dependencies; added translation string to CreateTeamSchema schema

This commit is contained in:
gbuomprisco
2024-09-13 11:03:31 +02:00
parent 4be76ac797
commit 5706a3486c
18 changed files with 244 additions and 233 deletions

View File

@@ -35,11 +35,11 @@
"@kit/ui": "workspace:^",
"@radix-ui/react-icons": "^1.3.0",
"@supabase/supabase-js": "^2.45.4",
"@tanstack/react-query": "5.55.4",
"@tanstack/react-query": "5.56.2",
"@types/react": "^18.3.5",
"@types/react-dom": "^18.3.0",
"lucide-react": "^0.440.0",
"next": "14.2.10",
"lucide-react": "^0.441.0",
"next": "14.2.11",
"next-themes": "0.3.0",
"react": "18.3.1",
"react-dom": "18.3.1",

View File

@@ -22,11 +22,11 @@
"@makerkit/data-loader-supabase-core": "^0.0.8",
"@makerkit/data-loader-supabase-nextjs": "^1.2.3",
"@supabase/supabase-js": "^2.45.4",
"@tanstack/react-query": "5.55.4",
"@tanstack/react-query": "5.56.2",
"@tanstack/react-table": "^8.20.5",
"@types/react": "^18.3.5",
"lucide-react": "^0.440.0",
"next": "14.2.10",
"lucide-react": "^0.441.0",
"next": "14.2.11",
"react": "18.3.1",
"react-dom": "18.3.1",
"react-hook-form": "^7.53.0",

View File

@@ -29,10 +29,10 @@
"@marsidev/react-turnstile": "^1.0.2",
"@radix-ui/react-icons": "^1.3.0",
"@supabase/supabase-js": "^2.45.4",
"@tanstack/react-query": "5.55.4",
"@tanstack/react-query": "5.56.2",
"@types/react": "^18.3.5",
"lucide-react": "^0.440.0",
"next": "14.2.10",
"lucide-react": "^0.441.0",
"next": "14.2.11",
"react-hook-form": "^7.53.0",
"react-i18next": "^15.0.1",
"sonner": "^1.5.0",

View File

@@ -21,9 +21,9 @@
"@kit/tsconfig": "workspace:*",
"@kit/ui": "workspace:*",
"@supabase/supabase-js": "^2.45.4",
"@tanstack/react-query": "5.55.4",
"@tanstack/react-query": "5.56.2",
"@types/react": "^18.3.5",
"lucide-react": "^0.440.0",
"lucide-react": "^0.441.0",
"react": "18.3.1",
"react-dom": "18.3.1",
"react-i18next": "^15.0.1"

View File

@@ -33,14 +33,14 @@
"@kit/tsconfig": "workspace:*",
"@kit/ui": "workspace:^",
"@supabase/supabase-js": "^2.45.4",
"@tanstack/react-query": "5.55.4",
"@tanstack/react-query": "5.56.2",
"@tanstack/react-table": "^8.20.5",
"@types/react": "^18.3.5",
"@types/react-dom": "^18.3.0",
"class-variance-authority": "^0.7.0",
"date-fns": "^3.6.0",
"lucide-react": "^0.440.0",
"next": "14.2.10",
"lucide-react": "^0.441.0",
"next": "14.2.11",
"react": "18.3.1",
"react-dom": "18.3.1",
"react-hook-form": "^7.53.0",

View File

@@ -4,26 +4,36 @@ import { z } from 'zod';
* @name RESERVED_NAMES_ARRAY
* @description Array of reserved names for team accounts
* This is a list of names that cannot be used for team accounts as they are reserved for other purposes.
* Please include any new reserved names here.
*/
const RESERVED_NAMES_ARRAY = [
'settings',
'billing',
// please add more reserved names here
'settings',
'billing',
// please add more reserved names here
];
const ReservedTeamNameSchema = z
.string()
.min(3)
/**
* @name TeamNameSchema
*/
const TeamNameSchema = z
.string({
description: 'The name of the team account',
})
.min(2)
.max(50)
.refine(
(name) => {
return !RESERVED_NAMES_ARRAY.includes(name);
},
{
message: 'This name is reserved and cannot be used for a team account',
message: 'teams:reservedNameError',
},
);
/**
* @name CreateTeamSchema
* @description Schema for creating a team account
*/
export const CreateTeamSchema = z.object({
name: ReservedTeamNameSchema,
name: TeamNameSchema,
});