Feat: Add role enum for user table

This commit is contained in:
Aaron William Po
2023-09-23 01:26:36 -04:00
parent bf56ca6058
commit 942f1390f7
11 changed files with 946 additions and 870 deletions

View File

@@ -32,6 +32,7 @@ const createNewUser = async ({
createdAt: true,
accountIsVerified: true,
updatedAt: true,
role: true,
},
});

View File

@@ -16,6 +16,7 @@ const deleteUserById = async (id: string) => {
createdAt: true,
accountIsVerified: true,
updatedAt: true,
role: true,
},
});

View File

@@ -16,6 +16,7 @@ const findUserById = async (id: string) => {
createdAt: true,
accountIsVerified: true,
updatedAt: true,
role: true,
},
});

View File

@@ -10,6 +10,7 @@ const GetUserSchema = z.object({
lastName: z.string(),
dateOfBirth: z.coerce.date(),
accountIsVerified: z.boolean(),
role: z.enum(['USER', 'ADMIN']),
});
export default GetUserSchema;

View File

@@ -16,6 +16,7 @@ const updateUserToBeConfirmedById = async (id: string) => {
lastName: true,
updatedAt: true,
dateOfBirth: true,
role: true,
},
});