Skip to content

Commit

Permalink
more cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
reinkrul committed Mar 28, 2024
1 parent 208d0fa commit 3016129
Showing 1 changed file with 0 additions and 30 deletions.
30 changes: 0 additions & 30 deletions web/src/plugins/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,36 +29,6 @@ function wrapClientCall(client, functionName, apiOptions, router) {
}
}
})

// TODO: Might have to handle the old functionality as well:
// return client[functionName](parameters).then((response) => {
// return response.json()
// .then((json) => {
// if (response.ok) {
// return Promise.resolve(json)
// } else {
// if (apiOptions.forbiddenRoute && response.status === 401) {
// return router.push(apiOptions.forbiddenRoute)
// } else {
// return Promise.reject(json.error)
// }
// }
// }).catch(reason => {
// // Handle 404 since it does not have content and the response.json() will fail.
// if (response.status === 404) {
// return Promise.reject(reason)
// }
// // Handle 204 since it does not have content and the response.json() will fail.
// if (response.status === 204) {
// return Promise.resolve(response)
// }
// // Handle 201 since it might not have content and the response.json() will fail.
// if (response.status === 201) {
// return Promise.resolve(response)
// }
// return Promise.reject(reason)
// })
// })
}
}

Expand Down

0 comments on commit 3016129

Please sign in to comment.