summaryrefslogtreecommitdiff
path: root/app/client/api/index.js
blob: 7551fb243cf4f54da2ce4e97bebafded599b1718 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import { crud_actions } from './crud.actions'
import util from '../util'
import * as parser from './parser'

/*
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 { util, parser }

export const actions = [
  'folder',
  'file',
  'dataset',
  'task',
  'user',
].reduce((a,b) => (a[b] = crud_actions(b)) && a, {})