Skip to content

Commit

Permalink
feat : 개발용 user 전체 정보 가져오는 라우터 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
seohyun-kim committed Dec 7, 2022
1 parent ead90ca commit 0d47ec6
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/server/routes/dev/getAllUsers.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import {defineSchema} from '../../libs/schema';
import {defineRoute} from '../../libs/route';
import {UserResponseSchemeForDev} from "../../../entity/schemes";
import UserService from "../../../service/UserService";

const schema = defineSchema({
tags: ['개발용'],
summary: '[테스트] 전체 유저 목록 가져옴',
description: '그냥 제가 보려고 만듦! ',

response: [UserResponseSchemeForDev]
});

export default defineRoute('get', '/all-users', schema, async (req, res) => {
const userInformation = await UserService.getAllUsers();

return res.json(await Promise.all(userInformation.map(e => e.toDevResponse())));
});

0 comments on commit 0d47ec6

Please sign in to comment.