-
Notifications
You must be signed in to change notification settings - Fork 806
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Kiran K
authored
Jan 16, 2024
1 parent
a8e83d9
commit 51fc00f
Showing
11 changed files
with
199 additions
and
111 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import { z } from 'zod'; | ||
import { isValidDomain } from '../common'; | ||
|
||
export const createApiKeySchema = z.object({ | ||
name: z.string().min(1, 'Name is required'), | ||
}); | ||
|
||
export const deleteApiKeySchema = z.object({ | ||
apiKeyId: z.string(), | ||
}); | ||
|
||
export const teamSlugSchema = z.object({ | ||
slug: z.string(), | ||
}); | ||
|
||
export const updateTeamSchema = z.object({ | ||
name: z.string().min(1, 'Name is required'), | ||
slug: z.string().min(3, 'Slug must be at least 3 characters'), | ||
domain: z | ||
.string() | ||
.optional() | ||
.refine( | ||
(domain) => { | ||
if (!domain) { | ||
return true; | ||
} | ||
|
||
return isValidDomain(domain); | ||
}, | ||
{ | ||
message: 'Enter a domain name in the format example.com', | ||
} | ||
), | ||
}); | ||
|
||
export const createTeamSchema = z.object({ | ||
name: z.string().min(1, 'Name is required'), | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.