Skip to content

Commit

Permalink
Sort calendar data received from API (#656)
Browse files Browse the repository at this point in the history
  • Loading branch information
jankrzempek authored and “BartkiewiczM” committed May 29, 2024
1 parent c504ecf commit c74384c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions app/javascript/react/store/movingCalendarStreamSlice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ export const movingStreamSlice = createSlice({
.addCase(fetchNewMovingStream.fulfilled, (state, { payload }) => {
state.status = StatusEnum.Fulfilled;
state.data = payload;
state.data.sort((a, b) => new Date(a.date).getTime() - new Date(b.date).getTime());
})
.addCase(fetchNewMovingStream.rejected, (state, { error }) => {
state.status = StatusEnum.Rejected;
Expand Down

0 comments on commit c74384c

Please sign in to comment.