summaryrefslogtreecommitdiff
path: root/frontend/views/upload/upload.reducer.js
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2020-05-30 17:27:04 +0200
committerJules Laplace <julescarbon@gmail.com>2020-05-30 17:27:04 +0200
commit0890fdd951d021308550a0db2e7b6f2593512957 (patch)
treea0050b153242ccde662fc0a957a79fc7a7edc4b4 /frontend/views/upload/upload.reducer.js
initial site copied in
Diffstat (limited to 'frontend/views/upload/upload.reducer.js')
-rw-r--r--frontend/views/upload/upload.reducer.js24
1 files changed, 24 insertions, 0 deletions
diff --git a/frontend/views/upload/upload.reducer.js b/frontend/views/upload/upload.reducer.js
new file mode 100644
index 0000000..674fcf8
--- /dev/null
+++ b/frontend/views/upload/upload.reducer.js
@@ -0,0 +1,24 @@
+import * as types from '../../types'
+import { session, getDefault, getDefaultInt } from '../../session'
+
+import { crudState, crudReducer } from '../../api/crud.reducer'
+
+const initialState = crudState('upload', {
+ options: {
+ sort: getDefault('upload.sort', 'id-desc'),
+ }
+})
+
+const reducer = crudReducer('upload')
+
+export default function uploadReducer(state = initialState, action) {
+ // console.log(action.type, action)
+ if (action.type === types.search.loaded && action.tag === 'query') {
+ // console.log("infer:", action.data.infer)
+ }
+ state = reducer(state, action)
+ switch (action.type) {
+ default:
+ return state
+ }
+}