From 4fe0fc45ff4ebeb7466646382244745f04b8b2a6 Mon Sep 17 00:00:00 2001 From: chavda-bhavik Date: Thu, 8 Jun 2023 11:16:33 +0530 Subject: [PATCH] fix: Update customization _id issue --- .../column/usecases/add-column/add-column.usecase.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/apps/api/src/app/column/usecases/add-column/add-column.usecase.ts b/apps/api/src/app/column/usecases/add-column/add-column.usecase.ts index 701d8dfde..963777cb9 100644 --- a/apps/api/src/app/column/usecases/add-column/add-column.usecase.ts +++ b/apps/api/src/app/column/usecases/add-column/add-column.usecase.ts @@ -1,6 +1,6 @@ import { Injectable } from '@nestjs/common'; import { FileMimeTypesEnum, createRecordFormat } from '@impler/shared'; -import { ColumnRepository, TemplateRepository, CustomizationRepository } from '@impler/dal'; +import { ColumnRepository, TemplateRepository, CustomizationRepository, CustomizationEntity } from '@impler/dal'; import { AddColumnCommand } from '../../commands/add-column.command'; import { StorageService } from '@impler/shared/dist/services/storage'; import { FileNameService } from '@shared/file/name.service'; @@ -36,11 +36,13 @@ export class AddColumn { const customization = await this.customizationRepository.findOne({ _templateId, }); - customization.recordVariables = variables; + const updateData: Partial = { + recordVariables: variables, + }; if (!customization.isRecordFormatUpdated) { - customization.recordFormat = createRecordFormat(variables); + updateData.recordFormat = createRecordFormat(variables); } - await this.customizationRepository.update({ _templateId }, customization); + await this.customizationRepository.update({ _templateId }, updateData); } async saveSampleFile(csvContent: string, templateId: string) {