mirror of
https://github.com/aaronpo97/the-biergarten-app.git
synced 2026-02-16 20:13:49 +00:00
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:
@@ -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({
|
||||
|
||||
@@ -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,
|
||||
});
|
||||
|
||||
@@ -17,7 +17,7 @@ const ProtectedPage: NextPage = () => {
|
||||
|
||||
const isDesktop = useMediaQuery('(min-width: 768px)');
|
||||
return (
|
||||
<div className="flex h-full flex-col items-center justify-center space-y-3 text-center">
|
||||
<div className="flex h-full flex-col items-center justify-center space-y-3 bg-primary text-center">
|
||||
{isLoading && <Spinner size={isDesktop ? 'xl' : 'md'} />}
|
||||
{user && !isLoading && (
|
||||
<>
|
||||
@@ -27,9 +27,7 @@ const ProtectedPage: NextPage = () => {
|
||||
{isEvening && 'evening'}
|
||||
{`, ${user?.firstName}!`}
|
||||
</h1>
|
||||
<h2 className="text-xl font-bold lg:text-4xl">
|
||||
Welcome to the Biergarten App!
|
||||
</h2>
|
||||
<h2 className="text-xl font-bold lg:text-4xl">Welcome to the Biergarten App!</h2>
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user