Add blog thumbnail and banner upload endpoints with storage keys.

Store image filenames in DB, resolve paths for cleanup on replace/delete, and reuse product-thumb multer limits.
This commit is contained in:
2026-09-16 11:40:05 +02:00
parent d38def2302
commit abe6208e4e
7 changed files with 138 additions and 15 deletions
@@ -0,0 +1,12 @@
import { getProductThumbMulterConfig } from '../../../config';
import { getBlogImagesDir } from '../../../config/uploadPaths';
import { createDiskStorageUploadOptions } from '../../../utils/createDiskStorageUploadOptions';
import { createUploadFilePipe } from '../../../utils/createUploadFilePipe';
const uploadDir = getBlogImagesDir();
export const blogImageUploadOptions = createDiskStorageUploadOptions(uploadDir);
const { allowedMimes, maxFileBytes } = getProductThumbMulterConfig();
export const blogImageFilePipe = createUploadFilePipe(allowedMimes, maxFileBytes);