Skip to content

Commit

Permalink
sort events after an event is updated
Browse files Browse the repository at this point in the history
  • Loading branch information
CooperW824 committed Jun 7, 2024
1 parent 25ec789 commit 7b01352
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/directors/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ export default function Page() {
updateEvent(updatedEvent).then((resp) => {
if (resp) {
// Update the event in the list of events
setEvents(events.map((e) => (e.id === resp.id ? resp : e)));
setEvents(
events.map((e) => (e.id === resp.id ? resp : e)).sort((a, b) => a.startTime - b.startTime),
);
}
});
}}
Expand Down

0 comments on commit 7b01352

Please sign in to comment.