Compare commits
No commits in common. "a63eaf0110f7c5a20f0bfc2c5aa9d453045e9290" and "39896fed90fcaf0710db9939c6b89dc3ad87d019" have entirely different histories.
a63eaf0110
...
39896fed90
|
@ -60,7 +60,7 @@ export abstract class BaseManager {
|
|||
try {
|
||||
this.setUser();
|
||||
|
||||
// this.queryRunner.startTransaction();
|
||||
this.queryRunner.startTransaction();
|
||||
this.baseLog.verbose('prepareData');
|
||||
await this.prepareData();
|
||||
|
||||
|
@ -80,10 +80,10 @@ export abstract class BaseManager {
|
|||
this.baseLog.verbose('afterProcess');
|
||||
await this.afterProcess();
|
||||
|
||||
// this.baseLog.verbose('commitTransaction');
|
||||
// await this.queryRunner.commitTransaction();
|
||||
this.baseLog.verbose('commitTransaction');
|
||||
await this.queryRunner.commitTransaction();
|
||||
|
||||
// await this.queryRunner.release();
|
||||
await this.queryRunner.release();
|
||||
} catch (e) {
|
||||
if (e.response) throw new Error(JSON.stringify(e.response));
|
||||
else throw new Error(e.message);
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import { HttpStatus, UnprocessableEntityException } from '@nestjs/common';
|
||||
import { Brackets } from 'typeorm';
|
||||
import * as _ from 'lodash';
|
||||
|
||||
// function ini bergungsi untuk validasi season period yang sama
|
||||
|
|
|
@ -13,7 +13,6 @@ import { ValidateSeasonPeriodHelper } from './helpers/validate.helper';
|
|||
@Injectable()
|
||||
export class UpdateSeasonPeriodManager extends BaseUpdateManager<SeasonPeriodEntity> {
|
||||
async validateProcess(): Promise<void> {
|
||||
if (!this.data.isUpdatePrice) {
|
||||
const priority = await ValidateSeasonPeriodHelper(
|
||||
this.dataService,
|
||||
this.data,
|
||||
|
@ -22,7 +21,6 @@ export class UpdateSeasonPeriodManager extends BaseUpdateManager<SeasonPeriodEnt
|
|||
Object.assign(this.data, {
|
||||
priority: priority,
|
||||
});
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -43,11 +43,8 @@ export class SeasonPeriodDataOrchestrator extends BaseDataTransactionOrchestrato
|
|||
return this.createManager.getResult();
|
||||
}
|
||||
|
||||
async update(dataId, data, updatePrice = false): Promise<SeasonPeriodEntity> {
|
||||
this.updateManager.setData(dataId, {
|
||||
...data,
|
||||
isUpdatePrice: updatePrice
|
||||
});
|
||||
async update(dataId, data): Promise<SeasonPeriodEntity> {
|
||||
this.updateManager.setData(dataId, data);
|
||||
this.updateManager.setService(this.serviceData, TABLE_NAME.SEASON_PERIOD);
|
||||
await this.updateManager.execute();
|
||||
return this.updateManager.getResult();
|
||||
|
|
|
@ -86,7 +86,7 @@ export class SeasonPeriodDataController {
|
|||
@Param('id') dataId: string,
|
||||
@Body() data: UpdateSeasonPeriodItemDto,
|
||||
): Promise<SeasonPeriodEntity> {
|
||||
return await this.orchestrator.update(dataId, data, true);
|
||||
return await this.orchestrator.update(dataId, data);
|
||||
}
|
||||
|
||||
@Delete(':id')
|
||||
|
|
Loading…
Reference in New Issue