This commit is contained in:
syuilo 2021-12-28 00:45:47 +09:00
parent 4ff49b0a3f
commit d2b634c349
5 changed files with 37 additions and 33 deletions

View file

@ -73,10 +73,10 @@ export class APIClient {
method: 'POST',
body: JSON.stringify({
...params,
i: credential !== undefined ? credential : this.credential
i: credential !== undefined ? credential : this.credential,
}),
credentials: 'omit',
cache: 'no-cache'
cache: 'no-cache',
}).then(async (res) => {
const body = res.status === 204 ? null : await res.json();
@ -87,7 +87,7 @@ export class APIClient {
} else {
reject({
[MK_API_ERROR]: true,
...body.error
...body.error,
});
}
}).catch(reject);