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

Status actions done, awaiting account actions

This commit is contained in:
Zhiyuan Zheng
2020-11-06 00:59:33 +01:00
parent 04b7b0a7b9
commit c08c25e3b5
13 changed files with 6743 additions and 391 deletions

View File

@ -8,7 +8,7 @@ const client = async ({
query,
body
}: {
method: 'get' | 'post'
method: 'get' | 'post' | 'delete'
instance: 'local' | 'remote'
endpoint: string
query?: {
@ -16,7 +16,7 @@ const client = async ({
}
body?: object
}): Promise<any> => {
const state: RootState['instanceInfo'] = store.getState().instanceInfo
const state: RootState["instanceInfo"] = store.getState().instanceInfo
let response
try {
@ -42,8 +42,8 @@ const client = async ({
body: await response.json()
})
} else {
console.error(response.error)
return Promise.reject({ body: response.error_message })
console.error(response.status + ': ' + response.statusText)
return Promise.reject({ body: response.statusText })
}
}