feat: client app can now upload images for beer posts

Updated seed to incorporate cloudinary images, downgraded multer to recent LTS, update tsconfig to allow spread operator usage on FileList.
This commit is contained in:
Aaron William Po
2023-05-07 21:05:21 -04:00
parent b457508a9b
commit f21dc905fe
15 changed files with 305 additions and 392 deletions

View File

@@ -29,7 +29,9 @@ const fileFilter: multer.Options['fileFilter'] = (req, file, cb) => {
};
const uploadMiddleware = expressWrapper(
multer({ storage, fileFilter, limits: { files: 3 } }).array('images'),
multer({ storage, fileFilter, limits: { files: 5, fileSize: 15 * 1024 * 1024 } }).array(
'images',
),
);
const BeerPostImageValidationSchema = z.object({

View File

@@ -46,9 +46,9 @@ const registerUser = async (req: RegisterUserRequest, res: NextApiResponse) => {
await sendConfirmationEmail(user);
res.status(200).json({
res.status(201).json({
success: true,
statusCode: 200,
statusCode: 201,
message: 'User registered successfully.',
payload: user,
});