* wip

* wip

* wip

* wip

* wip

* Update registry.value.vue

* wip

* wip

* wip

* wip

* typo
This commit is contained in:
syuilo
2021-01-11 20:38:34 +09:00
committed by GitHub
parent 1286dee1ab
commit 6c975275f8
37 changed files with 1017 additions and 100 deletions

View File

@@ -11,7 +11,7 @@ export default (endpoint: IEndpoint, ctx: Koa.Context) => new Promise((res) => {
const reply = (x?: any, y?: ApiError) => {
if (x == null) {
ctx.status = 204;
} else if (typeof x === 'number') {
} else if (typeof x === 'number' && y) {
ctx.status = x;
ctx.body = {
error: {
@@ -23,7 +23,8 @@ export default (endpoint: IEndpoint, ctx: Koa.Context) => new Promise((res) => {
}
};
} else {
ctx.body = x;
// 文字列を返す場合は、JSON.stringify通さないとJSONと認識されない
ctx.body = typeof x === 'string' ? JSON.stringify(x) : x;
}
res();
};