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 { generateOidcClientMetadata } from '@/oidc/utils';
|
||||||
import {
|
import {
|
||||||
deleteApplicationById,
|
deleteApplicationById,
|
||||||
|
findApplicationById,
|
||||||
insertApplication,
|
insertApplication,
|
||||||
updateApplicationById,
|
updateApplicationById,
|
||||||
} from '@/queries/application';
|
} 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(
|
router.patch(
|
||||||
'/application/:id',
|
'/application/:id',
|
||||||
koaGuard({
|
koaGuard({
|
||||||
|
|
Loading…
Add table
Reference in a new issue