Skip to content
This repository has been archived by the owner on May 14, 2024. It is now read-only.

Commit

Permalink
fix : 이미지 저장 형식 수정 (#194)
Browse files Browse the repository at this point in the history
  • Loading branch information
moonyaeyoon authored Feb 13, 2024
2 parents 4a62444 + 9a06cf1 commit dd97697
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/diary/diary.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,15 @@ export class DiaryService {
/*일지 수정하기*/
async updateDiary(diaryId, diaryInfo: PostDiaryDto) {
const diary = await DiaryEntity.updateDiary(diaryId, diaryInfo);
const diaryImg = await this.getDiaryImgUrl(diary, diaryInfo.fileName);
await DiaryImageEntity.updateDiaryImg(diary, diaryImg);
return response(BaseResponse.DIARY_CREATED);
if (
diaryInfo.fileName.startsWith('https://hereyou-cdn.kaaang.dev/diary/')
) {
return response(BaseResponse.DIARY_CREATED);
} else {
const diaryImg = await this.getDiaryImgUrl(diary, diaryInfo.fileName);
await DiaryImageEntity.updateDiaryImg(diary, diaryImg);
return response(BaseResponse.DIARY_CREATED);
}
}

/*일지 사진 S3에 업로드 후 url 받기- 생성 */
Expand Down

0 comments on commit dd97697

Please sign in to comment.