summaryrefslogtreecommitdiff
path: root/app/client/api/index.js
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2018-05-29 02:07:53 +0200
committerJules Laplace <julescarbon@gmail.com>2018-05-29 02:07:53 +0200
commit1fb8a9e663238eb15e1f92b93c5484867ea9feec (patch)
tree0160c7ef4c40fccb333cb3f34c01101f6917eb8d /app/client/api/index.js
parent453decc3deb494175a81ea7dd74e4074bc5d2e60 (diff)
default crud actions..
Diffstat (limited to 'app/client/api/index.js')
-rw-r--r--app/client/api/index.js23
1 files changed, 8 insertions, 15 deletions
diff --git a/app/client/api/index.js b/app/client/api/index.js
index 8db9c23..4e894e2 100644
--- a/app/client/api/index.js
+++ b/app/client/api/index.js
@@ -1,19 +1,12 @@
import FormData from 'form-data'
import fetch from 'node-fetch'
-import { crud_fetch, postBody } from './crud.fetch'
+import { crud_actions } from './crud.actions'
-export const folder = crud_fetch('folder')
-export const file = crud_fetch('file')
-export const dataset = crud_fetch('dataset')
-export const task = crud_fetch('task')
-
-// folder.upload = (folder_id, files) => {
-// var data = new FormData()
-// for (var i = 0; i < files.length; i++) {
-// data.append('file', files[i])
-// }
-// return fetch('/api/folders/' + folder_id, postBody(data))
-// .then(req => req.json())
-// .catch(error)
-// }
+export default [
+ 'folder',
+ 'file',
+ 'dataset',
+ 'task',
+ 'user',
+].reduce((a,b) => (a[b]=crud_actions(b))&&a, {})