summaryrefslogtreecommitdiff
path: root/frontend/api/crud.types.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/api/crud.types.js
parent2231a6e1c05b07bb7ec5906716aedec93d02429c (diff)
refactor to use app-rooted js imports
Diffstat (limited to 'frontend/api/crud.types.js')
-rw-r--r--frontend/api/crud.types.js36
1 files changed, 0 insertions, 36 deletions
diff --git a/frontend/api/crud.types.js b/frontend/api/crud.types.js
deleted file mode 100644
index 7b24811..0000000
--- a/frontend/api/crud.types.js
+++ /dev/null
@@ -1,36 +0,0 @@
-
-export const as_type = (a, b) => [a, b].join('_').toUpperCase()
-
-export const with_type = (type, actions) =>
- actions.reduce((a, b) => (a[b] = as_type(type, b)) && a, {})
-
-export const crud_type = (type, actions=[]) =>
- with_type(type, actions.concat([
- 'index_loading',
- 'index',
- 'index_error',
- 'index_sort',
- 'show_loading',
- 'show',
- 'show_error',
- 'create_loading',
- 'create',
- 'create_error',
- 'update_loading',
- 'update',
- 'update_error',
- 'destroy_loading',
- 'destroy',
- 'destroy_error',
- 'upload_loading',
- 'upload_progress',
- 'upload_waiting',
- 'upload_complete',
- 'upload_error',
- 'sort',
- 'update_option',
- 'update_options',
- 'loading',
- 'loaded',
- 'error',
- ]))