mirror of
https://github.com/logto-io/logto.git
synced 2025-02-17 22:04:19 -05:00
feat(core): get (#236)
This commit is contained in:
parent
ee49880845
commit
dd55c66644
1 changed files with 18 additions and 0 deletions
|
@ -25,6 +25,24 @@ export default function adminUserRoutes<T extends AuthedRouter>(router: T) {
|
|||
return next();
|
||||
});
|
||||
|
||||
router.get(
|
||||
'/users/:userId',
|
||||
koaGuard({
|
||||
params: object({ userId: string().min(1) }),
|
||||
}),
|
||||
async (ctx, next) => {
|
||||
const {
|
||||
params: { userId },
|
||||
} = ctx.guard;
|
||||
|
||||
const user = await findUserById(userId);
|
||||
|
||||
ctx.body = pick(user, ...userInfoSelectFields);
|
||||
|
||||
return next();
|
||||
}
|
||||
);
|
||||
|
||||
router.patch(
|
||||
'/users/:userId/roleNames',
|
||||
koaGuard({
|
||||
|
|
Loading…
Add table
Reference in a new issue