summaryrefslogtreecommitdiff
path: root/frontend/app/views/upload/upload.actions.js
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2020-09-26 14:56:02 +0200
committerJules Laplace <julescarbon@gmail.com>2020-09-26 14:56:02 +0200
commita17b76ac75f506f5da6fe8adf9c36632b60d4226 (patch)
treeabb0af0c4409b830dea2ef808c146223ee973933 /frontend/app/views/upload/upload.actions.js
parent2231a6e1c05b07bb7ec5906716aedec93d02429c (diff)
refactor to use app-rooted js imports
Diffstat (limited to 'frontend/app/views/upload/upload.actions.js')
-rw-r--r--frontend/app/views/upload/upload.actions.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/frontend/app/views/upload/upload.actions.js b/frontend/app/views/upload/upload.actions.js
new file mode 100644
index 0000000..8739bf7
--- /dev/null
+++ b/frontend/app/views/upload/upload.actions.js
@@ -0,0 +1,14 @@
+import actions from 'app/actions'
+import { session } from 'app/session'
+
+export const upload = file => dispatch => {
+ const formData = {
+ 'image': file,
+ 'username': session('username'),
+ }
+ // console.log(formData)
+ return actions.upload.upload(formData).then(data => {
+ // console.log(data.res)
+ return data.res
+ })
+}