Rework pagination and cookies

This commit is contained in:
Aaron William Po
2023-03-19 18:04:13 -04:00
parent 6b12cb72c5
commit cf6a8309f1
7 changed files with 53 additions and 50 deletions

View File

@@ -17,12 +17,6 @@ interface RegisterUserRequest extends NextApiRequest {
body: z.infer<typeof CreateUserValidationSchema>;
}
const { BASE_URL } = process.env;
if (!BASE_URL) {
throw new ServerError('BASE_URL env variable is not set.', 500);
}
const registerUser = async (req: RegisterUserRequest, res: NextApiResponse) => {
const [usernameTaken, emailTaken] = await Promise.all([
findUserByUsername(req.body.username),