mirror of
https://github.com/logto-io/logto.git
synced 2025-02-17 22:04:19 -05:00
feat(core): GET /application/:id
(#106)
This commit is contained in:
parent
211a5a1760
commit
5d5d43deee
1 changed files with 16 additions and 0 deletions
|
@ -5,6 +5,7 @@ import koaGuard from '@/middleware/koa-guard';
|
|||
import { generateOidcClientMetadata } from '@/oidc/utils';
|
||||
import {
|
||||
deleteApplicationById,
|
||||
findApplicationById,
|
||||
insertApplication,
|
||||
updateApplicationById,
|
||||
} from '@/queries/application';
|
||||
|
@ -37,6 +38,21 @@ export default function applicationRoutes<T extends AuthedRouter>(router: T) {
|
|||
}
|
||||
);
|
||||
|
||||
router.get(
|
||||
'/application/:id',
|
||||
koaGuard({
|
||||
params: object({ id: string().min(1) }),
|
||||
}),
|
||||
async (ctx, next) => {
|
||||
const {
|
||||
params: { id },
|
||||
} = ctx.guard;
|
||||
|
||||
ctx.body = await findApplicationById(id);
|
||||
return next();
|
||||
}
|
||||
);
|
||||
|
||||
router.patch(
|
||||
'/application/:id',
|
||||
koaGuard({
|
||||
|
|
Loading…
Add table
Reference in a new issue