@@ -31,10 +31,10 @@ export const createOrgFormSchema = z.object({
3131} ) ;
3232
3333export const updateOrganizationSchema = z . object ( {
34- organizationId : z . string ( ) . uuid ( 'Invalid organization ID' ) ,
34+ organizationId : z . uuid ( 'Invalid organization ID' ) ,
3535 name : z . string ( ) . min ( 1 ) . max ( 100 ) . optional ( ) ,
36- logoUrl : z . string ( ) . url ( 'Invalid URL' ) . nullable ( ) . optional ( ) ,
37- settings : z . record ( z . unknown ( ) ) . optional ( ) ,
36+ logoUrl : z . url ( 'Invalid URL' ) . nullable ( ) . optional ( ) ,
37+ settings : z . record ( z . string ( ) , z . unknown ( ) ) . optional ( ) ,
3838} ) ;
3939
4040/**
@@ -46,42 +46,42 @@ export const orgGeneralFormSchema = z.object({
4646} ) ;
4747
4848export const deleteOrganizationSchema = z . object ( {
49- organizationId : z . string ( ) . uuid ( 'Invalid organization ID' ) ,
49+ organizationId : z . uuid ( 'Invalid organization ID' ) ,
5050} ) ;
5151
5252export const getOrganizationSchema = z . object ( {
53- organizationId : z . string ( ) . uuid ( 'Invalid organization ID' ) ,
53+ organizationId : z . uuid ( 'Invalid organization ID' ) ,
5454} ) ;
5555
5656/**
5757 * Membership Schemas
5858 */
5959export const inviteMemberSchema = z . object ( {
60- organizationId : z . string ( ) . uuid ( 'Invalid organization ID' ) ,
61- email : z . string ( ) . email ( 'Invalid email address' ) ,
62- role : z . enum ( [ 'org:admin' , 'org:member' ] ) . default ( 'org:member' ) ,
60+ organizationId : z . uuid ( 'Invalid organization ID' ) ,
61+ email : z . email ( 'Invalid email address' ) ,
62+ role : z . enum ( [ 'org:admin' , 'org:member' ] ) . prefault ( 'org:member' ) ,
6363} ) ;
6464
6565/**
6666 * Form-specific schema for inviting members
6767 * Used for client-side form validation (organizationId provided separately)
6868 */
6969export const orgInviteFormSchema = z . object ( {
70- email : z . string ( ) . email ( 'Invalid email address' ) ,
70+ email : z . email ( 'Invalid email address' ) ,
7171 role : z . enum ( [ 'org:admin' , 'org:member' ] ) ,
7272} ) ;
7373
7474export const updateMemberRoleSchema = z . object ( {
75- organizationId : z . string ( ) . uuid ( 'Invalid organization ID' ) ,
75+ organizationId : z . uuid ( 'Invalid organization ID' ) ,
7676 clerkUserId : z . string ( ) . min ( 1 , 'User ID is required' ) ,
7777 role : z . enum ( [ 'org:admin' , 'org:member' ] ) ,
7878} ) ;
7979
8080export const removeMemberSchema = z . object ( {
81- organizationId : z . string ( ) . uuid ( 'Invalid organization ID' ) ,
81+ organizationId : z . uuid ( 'Invalid organization ID' ) ,
8282 clerkUserId : z . string ( ) . min ( 1 , 'User ID is required' ) ,
8383} ) ;
8484
8585export const getOrgMembersSchema = z . object ( {
86- organizationId : z . string ( ) . uuid ( 'Invalid organization ID' ) ,
86+ organizationId : z . uuid ( 'Invalid organization ID' ) ,
8787} ) ;
0 commit comments