Add dedicated blog image upload config separate from product thumbs.
Introduce MULTER_BLOG_IMAGE_* and VITE_BLOG_IMAGE_* env vars with backend multer helper and CMS config wiring for prod builds.
This commit is contained in:
@@ -128,6 +128,17 @@ export const getProductThumbMulterConfig = (): MulterConfig => {
|
||||
return { allowedMimes, maxFileBytes };
|
||||
};
|
||||
|
||||
export const getBlogImageMulterConfig = (): MulterConfig => {
|
||||
const allowedMimes = env('MULTER_BLOG_IMAGE_ALLOWED_MIMES')
|
||||
.split(',')
|
||||
.map(v => v.trim())
|
||||
.filter(Boolean);
|
||||
|
||||
const maxFileBytes = envInt('MULTER_BLOG_IMAGE_MAX_FILE_BYTES');
|
||||
|
||||
return { allowedMimes, maxFileBytes };
|
||||
};
|
||||
|
||||
export const getShopLogoMulterConfig = (): MulterConfig => {
|
||||
const allowedMimes = env('MULTER_SHOP_LOGO_ALLOWED_MIMES')
|
||||
.split(',')
|
||||
|
||||
Reference in New Issue
Block a user