1
0
Fork 0

Do not return promise

master
Ambrose Chua 2017-10-03 20:04:32 +08:00
parent 4be7857cab
commit 5d00ac5676
1 changed files with 3 additions and 1 deletions

View File

@ -74,7 +74,9 @@ input[type=submit]:active, input[type=button]:active {
method: e.target.method,
body: new FormData(e.target),
}).then(res => {
return { text: res.text(), res: res }
return res.text().then(text => {
return { text, res }
})
}).then(o => {
if (!o.res.ok) throw Error(o.text)
return o.text