Commit d9256c57 authored by Cyrille Bollu's avatar Cyrille Bollu
Browse files

Sort card by their order rather than by their id

Fixes #37

Signed-off-by: default avatarCyrille Bollu <cyrille@bollu.be>
parent fa5ee77b
Pipeline #457556 failed with stage
in 15 seconds
......@@ -13,12 +13,12 @@ export const boardSlice = createSlice({
state.value[action.payload.boardId].stacks.find(oneStack => oneStack.id === action.payload.stackId).cards[action.payload.card.id] = action.payload.card
},
addStack: (state, action) => {
// Stores cards in an object where cards are indexed by their id rather than in an array
// Stores cards in an object where cards are indexed by their order rather than in an array
const cards = action.payload.stack.cards
action.payload.stack.cards = {}
if (typeof cards !== 'undefined') {
cards.forEach(card => {
action.payload.stack.cards[card.id] = card
action.payload.stack.cards[card.order] = card
})
}
// Filter out existing stack with same id
......
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