fix: item rates not generated when create period season

pull/55/head
shancheas 2024-08-06 16:03:42 +07:00
parent 5dde995ab8
commit bacdb1773b
2 changed files with 9 additions and 14 deletions

View File

@ -28,19 +28,18 @@ export class SeasonPeriodHolidayHandler
holidayDate.creator_name = event.data.data.creator_name;
holidayDate.updated_at = event.data.data.updated_at;
holidayDate.season_type = event.data.data.season_type;
holidayDate.item_rates = event.data.data.item_rates;
holidayDate.item_rates = event.data.data.item_rates.map((item) => {
delete item['id'];
return item;
});
holidayDate.priority = 1;
holidayDates.push(holidayDate);
await this.dataService.createBatch(queryRunner, SeasonPeriodModel, [
holidayDate,
]);
}
// create batch
await this.dataService.createBatch(
queryRunner,
SeasonPeriodModel,
holidayDates,
);
// delete data
await this.dataService.deleteById(
queryRunner,

View File

@ -1,8 +1,4 @@
import {
HttpStatus,
Injectable,
UnprocessableEntityException,
} from '@nestjs/common';
import { Injectable } from '@nestjs/common';
import {
EventTopics,
columnUniques,