feat: Move get user API endpoint to admin namespace

This commit is contained in:
Faruk AYDIN
2024-02-24 00:40:45 +01:00
parent 532cfc10d0
commit ca7636e7bc
6 changed files with 46 additions and 41 deletions

View File

@@ -0,0 +1,16 @@
import { renderObject } from '../../../../../helpers/renderer.js';
import User from '../../../../../models/user.js';
export default async (request, response) => {
const user = await User.query()
.leftJoinRelated({
role: true,
})
.withGraphFetched({
role: true,
})
.findById(request.params.userId)
.throwIfNotFound();
renderObject(response, user);
};