mirror of
https://github.com/logto-io/logto.git
synced 2024-12-16 20:26:19 -05:00
chore(core): update custom phrase PUT API response status (#3830)
This commit is contained in:
parent
59a6ad3b7d
commit
7598ddefd7
2 changed files with 3 additions and 2 deletions
|
@ -154,7 +154,7 @@ describe('customPhraseRoutes', () => {
|
||||||
const response = await customPhraseRequest
|
const response = await customPhraseRequest
|
||||||
.put(`/custom-phrases/${mockLanguageTag}`)
|
.put(`/custom-phrases/${mockLanguageTag}`)
|
||||||
.send(translation);
|
.send(translation);
|
||||||
expect(response.status).toEqual(200);
|
expect(response.status).toEqual(201);
|
||||||
expect(response.body).toEqual(mockCustomPhrases[mockLanguageTag]);
|
expect(response.body).toEqual(mockCustomPhrases[mockLanguageTag]);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -67,7 +67,7 @@ export default function customPhraseRoutes<T extends AuthedRouter>(
|
||||||
params: object({ languageTag: languageTagGuard }),
|
params: object({ languageTag: languageTagGuard }),
|
||||||
body: translationGuard,
|
body: translationGuard,
|
||||||
response: CustomPhrases.guard,
|
response: CustomPhrases.guard,
|
||||||
status: [200, 422],
|
status: [201, 422],
|
||||||
}),
|
}),
|
||||||
async (ctx, next) => {
|
async (ctx, next) => {
|
||||||
const {
|
const {
|
||||||
|
@ -83,6 +83,7 @@ export default function customPhraseRoutes<T extends AuthedRouter>(
|
||||||
);
|
);
|
||||||
|
|
||||||
ctx.body = await upsertCustomPhrase(languageTag, translation);
|
ctx.body = await upsertCustomPhrase(languageTag, translation);
|
||||||
|
ctx.status = 201;
|
||||||
|
|
||||||
return next();
|
return next();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue