Skip to content

Commit

Permalink
2.5.13 rebuild item modifier lists every time
Browse files Browse the repository at this point in the history
  • Loading branch information
pauljonescodes committed Dec 27, 2023
1 parent d04bfe9 commit 1ae6b7f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/moa-square/services/items.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
ItemsPatchBody,
} from '../dto/catalogs/item-patch.dto.js';
import { CatalogImageEntity } from '../entities/catalog-image.entity.js';
import { ItemModifierListEntity } from '../entities/item-modifier-list.entity.js';
import { ItemEntity } from '../entities/item.entity.js';
import { CatalogImagesService } from './catalog-images.service.js';
import { CategoriesService } from './categories.service.js';
Expand Down Expand Up @@ -94,6 +95,12 @@ export class ItemsService extends EntityRepositoryService<ItemEntity> {

moaItem = await this.save(moaItem);

await this.itemModifierListService.removeAll(
await this.loadManyRelation<ItemModifierListEntity>(
moaItem,
'itemModifierLists',
),
);
for (const squareItemModifierListInfo of squareItemData.modifierListInfo ??
[]) {
await this.itemModifierListService.process({
Expand Down

0 comments on commit 1ae6b7f

Please sign in to comment.