Skip to content

Commit

Permalink
merge #365: image URL 반환 시 image Path 필드도 함께 반환하게 함
Browse files Browse the repository at this point in the history
[chore] image URL 반환 시 image Path 필드도 함께 반환하게 함
  • Loading branch information
yaongmeow authored Dec 13, 2023
2 parents 793ffa3 + f1e8249 commit 1cc60c0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 2 additions & 0 deletions BE/src/postings/postings.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ export class PostingsService {
thumbnail: posting.p_thumbnail
? await this.storageService.getImageUrl(posting.p_thumbnail)
: null,
thumbnailPath: posting.p_thumbnail,
period: posting.p_period,
headcount: posting.p_headcount,
budget: posting.p_budget,
Expand All @@ -219,6 +220,7 @@ export class PostingsService {
avatar: posting.u_avatar
? await this.storageService.getImageUrl(posting.u_avatar)
: null,
avatarPath: posting.u_avatar,
},
likeds: posting.likeds,
reports: posting.reports,
Expand Down
8 changes: 5 additions & 3 deletions BE/src/timelines/timelines.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,19 +68,21 @@ export class TimelinesService {
return {
...timeline,
image: imageUrl,
imagePath: timeline.image,
};
})
);
}

async findOneWithURL(id: string) {
const timeline = await this.findOne(id);
const imagePath = timeline.image;

if (timeline.image) {
timeline.image = await this.storageService.getImageUrl(timeline.image);
if (imagePath) {
timeline.image = await this.storageService.getImageUrl(imagePath);
}

return timeline;
return { ...timeline, imagePath };
}

@Transactional()
Expand Down

0 comments on commit 1cc60c0

Please sign in to comment.