0
Fork 0
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:
Xiao Yijun 2022-02-16 15:56:51 +08:00 committed by GitHub
parent ee49880845
commit dd55c66644
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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({