Skip to content

Commit

Permalink
fix(#147): user 정보 업데이트 에러 수정 (#148)
Browse files Browse the repository at this point in the history
  • Loading branch information
kimhji authored Nov 26, 2024
1 parent b06ef51 commit 9311613
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions apps/backend/src/user/user.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,19 @@ export class UserService {
}

getObjUser(updateData: UserPatchDTO) {
let nickname = '';
let profilePath = '';
if (updateData.nickname && isString(updateData.nickname)) nickname = updateData.nickname;
if (updateData.profile) profilePath = updateData.profile;
if (!nickname && !profilePath) {
const obj: any = {};

if (updateData.nickname && isString(updateData.nickname)) {
obj.nickname = updateData.nickname;
}
if (updateData.profile) {
obj.profilePath = updateData.profile;
}
if (Object.keys(obj).length === 0) {
throw new HttpException('wrong user data', HttpStatus.BAD_REQUEST);
}
return { nickname, profilePath };

return obj;
}

async loginUser(tokenData) {
Expand Down

0 comments on commit 9311613

Please sign in to comment.