error validation

This commit is contained in:
Delucse
2020-09-19 09:38:38 +02:00
parent b20bde4e83
commit 111b924988
10 changed files with 268 additions and 73 deletions
+11 -3
View File
@@ -1,9 +1,9 @@
import { BUILDER_CHANGE, BUILDER_TITLE, BUILDER_ID, BUILDER_ADD_STEP, BUILDER_DELETE_STEP, BUILDER_CHANGE_STEP,BUILDER_CHANGE_ORDER, BUILDER_DELETE_PROPERTY } from '../actions/types';
import { BUILDER_CHANGE, BUILDER_ERROR, BUILDER_TITLE, BUILDER_ID, BUILDER_ADD_STEP, BUILDER_DELETE_STEP, BUILDER_CHANGE_STEP,BUILDER_CHANGE_ORDER, BUILDER_DELETE_PROPERTY } from '../actions/types';
const initialState = {
change: 0,
title: '',
id: 0,
id: '',
steps: [
{
id: 1,
@@ -13,7 +13,10 @@ const initialState = {
hardware: [],
requirements: []
}
]
],
error: {
steps: [{}]
}
};
export default function(state = initialState, action){
@@ -42,6 +45,11 @@ export default function(state = initialState, action){
...state,
steps: action.payload
};
case BUILDER_ERROR:
return {
...state,
error: action.payload
}
default:
return state;
}