continue extracting user controllers out of routes

This commit is contained in:
Aaron William Po
2023-12-06 20:30:11 -05:00
parent 2ff39613cd
commit c7d5c65ffb
31 changed files with 584 additions and 543 deletions

View File

@@ -33,7 +33,7 @@ const checkIfUserCanUpdateProfile = async (
await next();
};
const updateProfile = async (req: UpdateProfileRequest, res: NextApiResponse) => {
const updateAvatar = async (req: UpdateProfileRequest, res: NextApiResponse) => {
const { file, user } = req;
const avatar: UpdateUserAvatarByIdParams['data']['avatar'] = {
@@ -60,7 +60,7 @@ router.put(
checkIfUserCanUpdateProfile,
// @ts-expect-error
singleUploadMiddleware,
updateProfile,
updateAvatar,
);
const handler = router.handler();