Commit fd21d29e authored by Rémy Huet's avatar Rémy Huet 💻

Update redux

parent ce7f7b0e
Pipeline #31974 passed with stage
in 53 seconds
......@@ -71,6 +71,30 @@ export default function reducer(state = initialState, action) {
info: 'Impossible de créer la catégorie',
};
}
case ('UPDATE_CATEGORY_PENDING'): {
return {
...state,
action: 'UPDATE',
success: null,
};
}
case ('UPDATE_CATEGORY_FULFILLED'): {
return {
...state,
categories: state.categories.map(
category => (category.id === action.payload.data.id ? action.payload.data : category),
),
success: true,
info: 'Catégorie mise à jour avec succès',
};
}
case ('UPDATE_CATEGORY_REJECTED'): {
return {
...state,
success: false,
info: 'Impossible de mettre à jour la catégorie',
};
}
case ('CATEGORY_MESSAGE_DISMISS'): {
return {
...state,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment