From 97dd920753f627ba79fcf2d1f8d4e848ef54698e Mon Sep 17 00:00:00 2001 From: kmi0817 Date: Tue, 16 Jan 2024 00:53:17 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=EC=9D=B4=EB=AF=B8=EC=A7=80=EA=B0=80=20?= =?UTF-8?q?=EC=A0=84=EC=86=A1=EB=90=98=EC=A7=80=20=EC=95=8A=EC=9D=84=20?= =?UTF-8?q?=EC=8B=9C=20=EC=9D=B4=EB=AF=B8=EC=A7=80=20=ED=95=84=EB=93=9C?= =?UTF-8?q?=EB=A5=BC=20null=EB=A1=9C=20=EC=B2=98=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BE/src/timelines/timelines.service.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/BE/src/timelines/timelines.service.ts b/BE/src/timelines/timelines.service.ts index f3d2337..7b03a26 100644 --- a/BE/src/timelines/timelines.service.ts +++ b/BE/src/timelines/timelines.service.ts @@ -61,7 +61,7 @@ export class TimelinesService { return this.timelinesRepository.save(timeline); } catch (error) { if (imagePath) { - this.storageService.delete(imagePath); + await this.storageService.delete(imagePath); } throw error; @@ -119,6 +119,8 @@ export class TimelinesService { ); imagePath = path; updatedTimeline.image = imagePath; + } else { + updatedTimeline.image = null; } const updatedResult = await this.timelinesRepository.update( @@ -137,7 +139,7 @@ export class TimelinesService { return updatedResult; } catch (error) { if (imagePath) { - this.storageService.delete(imagePath); + await this.storageService.delete(imagePath); } throw error;