summaryrefslogtreecommitdiff
path: root/app/client/api/index.js
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2018-05-29 02:13:32 +0200
committerJules Laplace <julescarbon@gmail.com>2018-05-29 02:13:32 +0200
commitb0440c213ac9f97e558b3d15d3740dab234b7b79 (patch)
treec4ffdafb60272dd1fbdb04cd6d2c9ac486d15f71 /app/client/api/index.js
parent1fb8a9e663238eb15e1f92b93c5484867ea9feec (diff)
merge actions with one final reducer
Diffstat (limited to 'app/client/api/index.js')
-rw-r--r--app/client/api/index.js15
1 files changed, 14 insertions, 1 deletions
diff --git a/app/client/api/index.js b/app/client/api/index.js
index 4e894e2..6f12227 100644
--- a/app/client/api/index.js
+++ b/app/client/api/index.js
@@ -3,10 +3,23 @@ import fetch from 'node-fetch'
import { crud_actions } from './crud.actions'
+/*
+for our crud events, create corresponding actions
+the actions fire a 'loading' event, call the underlying api method, and then resolve.
+so you can do ...
+ import { folderActions } from '../../api'
+ folderActions.index({ module: 'samplernn' })
+ folderActions.show(12)
+ folderActions.create({ module: 'samplernn', name: 'foo' })
+ folderActions.update(12, { module: 'pix2pix' })
+ folderActions.destroy(12, { confirm: true })
+ folderActions.upload(12, form_data)
+*/
+
export default [
'folder',
'file',
'dataset',
'task',
'user',
-].reduce((a,b) => (a[b]=crud_actions(b))&&a, {})
+].reduce((a,b) => (a[b + 'Actions'] = crud_actions(b)) && a, {})