Skip to content

Commit 801dac7

Browse files
committed
Sorting events in descending order
1 parent f017cf7 commit 801dac7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/views/admin/DashboardView.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<script setup>
2-
import { mdiAlphaACircle, mdiAbTesting, mdiNoteAlert, mdiClipboardCheck, mdiAccountTie, mdiAlphaBCircleOutline, mdiAccountMultiple, mdiAccountSchoolOutline, mdiProgressClock, mdiViewDashboard, mdiCommentProcessing, mdiMonitorAccount, mdiAccountCancel, mdiAlphaSBox, mdiClockTimeEight, mdiCalendarClock, mdiAccountGroup, mdiOfficeBuilding } from "@mdi/js";
2+
import { mdiAlphaACircle, mdiAbTesting, mdiNoteAlert, mdiClipboardCheck, mdiAccountTie, mdiAlphaBCircleOutline, mdiAccountMultiple, mdiAccountSchoolOutline, mdiProgressClock, mdiViewDashboard, mdiCardSearch, mdiMonitorAccount, mdiAccountCancel, mdiAlphaSBox, mdiClockTimeEight, mdiCalendarClock, mdiAccountGroup, mdiOfficeBuilding } from "@mdi/js";
33
import { adminStore, mainStore, snackBarStore } from "@/main.js";
44
import { layoutStore } from "@/main";
55
@@ -75,7 +75,7 @@ onMounted(async () => {
7575
eventsFetchError.value = true;
7676
snackBarStore.pushMessage("Nakon više ponovljenih pokušaja, nije moguće dohvatiti evente.", "danger");
7777
} else {
78-
events.value = fetchedEvents.filter((event) => !ActivityEventMappings.shouldSkipEvent(event.activity_id)).reverse();
78+
events.value = fetchedEvents.filter((event) => !ActivityEventMappings.shouldSkipEvent(event.activity_id)).sort((a, b) => new Date(b.timestamp) - new Date(a.timestamp));
7979
}
8080
} catch (error) {
8181
console.error("Dashboard rendering error:", error);
@@ -214,7 +214,7 @@ const toggleDateType = () => {
214214
<SkeletonLoader v-else></SkeletonLoader>
215215
</div>
216216

217-
<SectionTitleLineWithButton :icon="mdiCommentProcessing" title="Najnoviji događaji" main @click="eventsOptionsActive = true"> </SectionTitleLineWithButton>
217+
<SectionTitleLineWithButton :icon="mdiCardSearch" title="Najnoviji događaji" main @click="eventsOptionsActive = true"> </SectionTitleLineWithButton>
218218

219219
<div v-if="!eventsFetchError" class="flex flex-wrap md:flex-row">
220220
<div class="mb-4">

0 commit comments

Comments
 (0)