mirror of
https://github.com/andwati/order-service.git
synced 2026-10-28 06:42:17 +00:00
added get users admin only endpoint
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
import type { Request, Response, NextFunction } from "express";
|
||||
import { UserService } from "../services/user.service.js";
|
||||
|
||||
export class UserController {
|
||||
static async getAll(_req: Request, res: Response, next: NextFunction) {
|
||||
try {
|
||||
const users = await UserService.getAll();
|
||||
res.status(200).json(users);
|
||||
} catch (err) {
|
||||
next(err);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user