Service logic
Implementing the actual logic for managing the products' images.
await this.findOne(id);export const FilePath = {
Products: {
BASE: 'products',
IMAGES: 'images',
},
} as const satisfies Record<string, Record<string, string>>;const { BASE, IMAGES } = FilePath.Products;
const path = join(BASE, id.toString(), IMAGES);if (await pathExists(join(BASE_PATH, path))) {
const incomingFilecount = files.length;
const dirFilecount = await this.storageService.getDirFilecount(path);
const totalFilecount = incomingFilecount + dirFilecount;
this.storageService.validateFilecount(totalFilecount, MaxFileCount.PRODUCT_IMAGES);
}Last updated