mirror of
https://github.com/aaronpo97/the-biergarten-app.git
synced 2026-02-16 20:13:49 +00:00
continue extracting user controllers out of routes
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user