This commit is contained in:
2025-12-06 23:51:50 +03:30
parent 7567e00f8a
commit eb48187ad0
5 changed files with 31 additions and 6 deletions
@@ -46,6 +46,7 @@ export class FoodService {
inPlaceServe: rest.inPlaceServe ?? false,
pickupServe: rest.pickupServe ?? false,
discount: rest.discount ?? 0,
isSpecialOffer: rest.isSpecialOffer ?? false,
// map single-title/content DTO to localized fields
title: rest.title,
content: rest.content,
@@ -103,6 +104,10 @@ export class FoodService {
this.em.assign(food, { category: category });
}
// assign other fields from DTO
const { categoryId, ...rest } = dto;
this.em.assign(food, rest);
await this.em.persistAndFlush(food);
return food;
}