mirror of
https://github.com/logto-io/logto.git
synced 2024-12-16 20:26:19 -05:00
fix(core): fix the post domains api error status code (#5552)
fix the post domains api error status code
This commit is contained in:
parent
62bd784d4e
commit
a9b927910d
1 changed files with 2 additions and 1 deletions
|
@ -60,7 +60,7 @@ export default function domainRoutes<T extends AuthedRouter>(
|
|||
koaGuard({
|
||||
body: Domains.createGuard.pick({ domain: true }),
|
||||
response: domainResponseGuard,
|
||||
status: [201, 422],
|
||||
status: [201, 422, 400],
|
||||
}),
|
||||
async (ctx, next) => {
|
||||
const existingDomains = await findAllDomains();
|
||||
|
@ -72,6 +72,7 @@ export default function domainRoutes<T extends AuthedRouter>(
|
|||
})
|
||||
);
|
||||
|
||||
// Throw 400 error if domain is invalid
|
||||
const syncedDomain = await addDomain(ctx.guard.body.domain);
|
||||
|
||||
ctx.status = 201;
|
||||
|
|
Loading…
Reference in a new issue