about summary refs log tree commit diff
path: root/app/javascript/flavours/glitch/reducers/rules.js
diff options
context:
space:
mode:
authorClaire <claire.github-309c@sitedethib.com>2022-02-23 22:21:58 +0100
committerGitHub <noreply@github.com>2022-02-23 22:21:58 +0100
commite48eaf64cc7cb0cfab388331c4823ee5fb580d59 (patch)
tree18daedde9a2b7087e0b5e160680ed366cdd02546 /app/javascript/flavours/glitch/reducers/rules.js
parent8c9c05d57914236dc7104a67e84743e1ce36f7cc (diff)
parent41ef41b9006e42b4001ebd89a3091fce609359fc (diff)
Merge pull request #1701 from ClearlyClaire/glitch-soc/merge-upstream
Merge upstream changes
Diffstat (limited to 'app/javascript/flavours/glitch/reducers/rules.js')
-rw-r--r--app/javascript/flavours/glitch/reducers/rules.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/app/javascript/flavours/glitch/reducers/rules.js b/app/javascript/flavours/glitch/reducers/rules.js
new file mode 100644
index 000000000..6cc2230bc
--- /dev/null
+++ b/app/javascript/flavours/glitch/reducers/rules.js
@@ -0,0 +1,13 @@
+import { RULES_FETCH_SUCCESS } from 'flavours/glitch/actions/rules';
+import { List as ImmutableList, fromJS } from 'immutable';
+
+const initialState = ImmutableList();
+
+export default function rules(state = initialState, action) {
+  switch (action.type) {
+  case RULES_FETCH_SUCCESS:
+    return fromJS(action.rules);
+  default:
+    return state;
+  }
+}