Skip to content

Commit

Permalink
merge #400 from kmi0817/be-feature/#399-image-delete
Browse files Browse the repository at this point in the history
[fix] ํƒ€์ž„๋ผ์ธ ์ด๋ฏธ์ง€ ์ œ๊ฑฐ ์‹œ ์˜ˆ์ „ ์ด๋ฏธ์ง€ URL์ด ๋ฐ˜ํ™˜๋˜๋Š” ๋ฌธ์ œ ํ•ด๊ฒฐ
  • Loading branch information
yaongmeow authored Jan 15, 2024
2 parents c332c08 + 97dd920 commit 503dd20
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions BE/src/timelines/timelines.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -119,6 +119,8 @@ export class TimelinesService {
);
imagePath = path;
updatedTimeline.image = imagePath;
} else {
updatedTimeline.image = null;
}

const updatedResult = await this.timelinesRepository.update(
Expand All @@ -137,7 +139,7 @@ export class TimelinesService {
return updatedResult;
} catch (error) {
if (imagePath) {
this.storageService.delete(imagePath);
await this.storageService.delete(imagePath);
}

throw error;
Expand Down

0 comments on commit 503dd20

Please sign in to comment.