food
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user