summaryrefslogtreecommitdiff
path: root/animism-align/frontend/app/utils/index.js
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2020-10-12 19:11:07 +0200
committerJules Laplace <julescarbon@gmail.com>2020-10-12 19:11:07 +0200
commit2ebe47a0ec566be75522da533e76a2f491227a51 (patch)
tree13fb04119086e45e24078dfef1ee46abdddb7002 /animism-align/frontend/app/utils/index.js
parent4368c66b4efddbda87335c42d82dc562629bd0e9 (diff)
new annotations
Diffstat (limited to 'animism-align/frontend/app/utils/index.js')
-rw-r--r--animism-align/frontend/app/utils/index.js26
1 files changed, 16 insertions, 10 deletions
diff --git a/animism-align/frontend/app/utils/index.js b/animism-align/frontend/app/utils/index.js
index 03c484c..ac4b83b 100644
--- a/animism-align/frontend/app/utils/index.js
+++ b/animism-align/frontend/app/utils/index.js
@@ -231,16 +231,22 @@ export const post = (dispatch, type=api_type, tag, url, data) => {
headers,
})
.then(res => res.json())
- .then(res => dispatch({
- type: type.loaded,
- tag,
- data: res,
- }))
- .catch(err => dispatch({
- type: type.error,
- tag,
- err,
- }))
+ .then(res => {
+ dispatch({
+ type: type.loaded,
+ tag,
+ data: res,
+ })
+ return res
+ })
+ .catch(err => {
+ dispatch({
+ type: type.error,
+ tag,
+ err,
+ })
+ return err
+ })
}
export const api = (dispatch, type=api_type, tag, url, data) => {