diff options
Diffstat (limited to 'app/client/api/index.js')
| -rw-r--r-- | app/client/api/index.js | 23 |
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, {}) |
