Commit 256b8285 authored by Yoon, Daeki's avatar Yoon, Daeki 😅
Browse files

메소드 위치 변경

parent f5f8f2b1
...@@ -2,10 +2,6 @@ import { NextFunction, Request, Response } from "express"; ...@@ -2,10 +2,6 @@ import { NextFunction, Request, Response } from "express";
import { userDb } from "../db"; import { userDb } from "../db";
import { asyncWrap } from "../helpers/asyncWrap"; import { asyncWrap } from "../helpers/asyncWrap";
import { TypedRequestAuth } from "./auth.controller"; import { TypedRequestAuth } from "./auth.controller";
export const getUsers = asyncWrap(async (req, res) => {
const users = await userDb.getUsers();
return res.json(users);
});
export const createUser = asyncWrap(async (req, res) => { export const createUser = asyncWrap(async (req, res) => {
const user = req.body; const user = req.body;
...@@ -21,6 +17,11 @@ export const deleteUser = asyncWrap(async (req, res) => { ...@@ -21,6 +17,11 @@ export const deleteUser = asyncWrap(async (req, res) => {
return res.json(deletedUser); return res.json(deletedUser);
}); });
export const getUsers = asyncWrap(async (req, res) => {
const users = await userDb.getUsers();
return res.json(users);
});
export const userById = async ( export const userById = async (
reqExp: Request, reqExp: Request,
res: Response, res: Response,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment