Skip to content

Commit

Permalink
modify(#10): 내정보GET API에 내 아이디를 userId로 명시
Browse files Browse the repository at this point in the history
  • Loading branch information
NicoDora committed Nov 8, 2023
1 parent e6f3fd5 commit df3e8fb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/users/services/user.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ export class UserService {
) {}

async getMyInfo(userId: number) {
const { id, name, email, gender, admin, provider } =
const { name, email, gender, admin, provider } =
await this.userRepository.getUserInfo(userId);
const userImage = (await this.userImageRepository.checkUserImage(userId))
.imageUrl;
return {
id,
userId,
name,
email,
gender,
Expand Down
11 changes: 10 additions & 1 deletion src/users/swagger-decorators/get-my-info-decorator.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { applyDecorators } from '@nestjs/common';
import { ApiOperation, ApiResponse } from '@nestjs/swagger';
import { ApiHeaders, ApiOperation, ApiResponse } from '@nestjs/swagger';

export function ApiGetMyInfo() {
return applyDecorators(
Expand All @@ -13,6 +13,7 @@ export function ApiGetMyInfo() {
content: {
JSON: {
example: {
userId: 62,
name: '박준혁',
email: '[email protected]',
gender: 'M',
Expand All @@ -37,5 +38,13 @@ export function ApiGetMyInfo() {
},
},
}),
ApiHeaders([
{
name: 'access_token',
description: '액세스 토큰',
required: true,
example: '여기에 액세스 토큰',
},
]),
);
}

0 comments on commit df3e8fb

Please sign in to comment.