Skip to content

Commit

Permalink
merge: #366 이미지 URL과 함께 경로도 같이 반환하도록 수정
Browse files Browse the repository at this point in the history
[chore] 이미지 URL과 함께 경로도 같이 반환하도록 수정
  • Loading branch information
kmi0817 authored Dec 13, 2023
2 parents 146e213 + ffd70c9 commit 2d16131
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
4 changes: 4 additions & 0 deletions BE/src/users/dto/user-info.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,8 @@ export class UserInfoDto {
@IsString()
@ApiProperty({ nullable: true })
avatar: string;

@IsString()
@ApiProperty({ nullable: true })
avatarPath: string;
}
4 changes: 2 additions & 2 deletions BE/src/users/users.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,13 @@ export class UsersService {
return this.userRepository.findById(id);
}

async getUserInfoById(id: string): Promise<UserInfoDto> {
async getUserInfoById(id: string) {
const user = await this.userRepository.findById(id);
const avatarPath = user.avatar;
if (user.avatar !== null) {
user.avatar = await this.storageService.getImageUrl(avatarPath);
}
return { name: user.name, avatar: user.avatar };
return { name: user.name, avatar: user.avatar, avatarPath };
}

async getUserInfoByResourceId(resourceId: string) {
Expand Down
1 change: 1 addition & 0 deletions BE/src/users/users.swagger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ export const Users = {
name: '레몬',
avatar:
'https://traveline.kr.object.ncloudstorage.com/123456789012345678901234567890123456/bd67709e-0a62-4cb2-acb5-a26d539f90e5.jpg?AWSAccessKeyId=qjvpzL57YZV54DgXNdvd&Expires=1701542436&Signature=PLHDtpwQVMT0SeM5hsGWl%2F7JV2w%3D',
avatarPath: '123456789012345678901234567890123456/lemon.jpg',
};

export const getUsersDuplicate = {
Expand Down

0 comments on commit 2d16131

Please sign in to comment.