Skip to content

Commit 33dbada

Browse files
author
Mayur
committed
feat: Optimized the method call
1 parent af89bb1 commit 33dbada

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

apps/api/src/app/review/usecases/start-process/start-process.usecase.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ export class StartProcess {
4444
});
4545
}
4646

47+
await this.updateTemplateStatistics({ uploadInfo, userEmail });
48+
4749
// if destination is frontend or not defined then complete the upload process
4850
if (
4951
!destination ||
@@ -53,16 +55,12 @@ export class StartProcess {
5355
{ _id: _uploadId },
5456
{ status: UploadStatusEnum.COMPLETED }
5557
);
56-
57-
await this.updateTemplateStatistics({ uploadInfo, userEmail });
5858
} else {
5959
// if template destination has callbackUrl then start sending data to the callbackUrl
6060
uploadInfo = await this.uploadRepository.findOneAndUpdate(
6161
{ _id: _uploadId },
6262
{ status: UploadStatusEnum.PROCESSING }
6363
);
64-
65-
await this.updateTemplateStatistics({ uploadInfo, userEmail });
6664
}
6765

6866
this.amplitudeService.recordsImported(userEmail, {

0 commit comments

Comments
 (0)