1
0
mirror of https://github.com/tooot-app/app synced 2025-06-05 22:19:13 +02:00

Improved translation response

This commit is contained in:
Zhiyuan Zheng
2022-02-08 22:19:24 +01:00
parent 11c22907af
commit 311020285d
5 changed files with 35 additions and 14 deletions

View File

@ -53,7 +53,9 @@ const apiTooot = async <T = unknown>({
Accept: '*/*',
...headers
},
...(body && { data: body })
...(body && { data: body }),
validateStatus: status =>
url.includes('translate') ? status < 500 : status === 200
})
.then(response => {
return Promise.resolve({