core&ui: add problem_config

Co-authored-by: undefined <i@undefined.moe>
This commit is contained in:
pandaandundefined committed 2022-05-10 01:50:23 +08:00
1 parent 0b71b089e0
commit 1f498484d2
20 files changed
+1128 -159

No files matched your search

@@ -0,0 +1,16 @@
export default function reducer(state = [], action) {
switch (action.type) {
case 'CONFIG_LOAD_FULFILLED': {
return state.concat(action.payload.testdata);
}
case 'CONFIG_DELETE_TESTDATA': {
return state.filter((i) => i.name !== action.payload.name);
}
case 'CONFIG_ADD_TESTDATA': {
state.push(action.payload);
return state;
}
default:
return state;
}
}