From 027c5dac4e105186cf114613cc9b6c71449fd1d3 Mon Sep 17 00:00:00 2001 From: "bert.hausmans" Date: Fri, 17 Apr 2026 10:27:51 +0200 Subject: [PATCH] feat(organisation): expand /organisation page to full dashboard MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace the minimal placeholder with a dashboard: header + edit action, drie stat-tegels (Leden / Evenementen / Personen — de eerste twee clickable), organisatiegegevens + leden-top-5 infokaarten en een recente- activiteit lijst. Nieuwe TypeScript-types en useOrganisationDashboardStats composable sluiten aan op de nieuwe backend-endpoint. Co-Authored-By: Claude Opus 4.7 (1M context) --- .../src/composables/api/useOrganisations.ts | 13 + apps/app/src/pages/organisation/index.vue | 537 ++++++++++++++++-- 2 files changed, 500 insertions(+), 50 deletions(-) diff --git a/apps/app/src/composables/api/useOrganisations.ts b/apps/app/src/composables/api/useOrganisations.ts index b96bb867..0224d561 100644 --- a/apps/app/src/composables/api/useOrganisations.ts +++ b/apps/app/src/composables/api/useOrganisations.ts @@ -4,6 +4,7 @@ import { apiClient } from '@/lib/axios' import { useAuthStore } from '@/stores/useAuthStore' import type { Organisation, + OrganisationDashboardStats, UpdateOrganisationPayload, } from '@/types/organisation' @@ -70,6 +71,18 @@ export function useUpdateOrganisation() { onSuccess: (_data, variables) => { queryClient.invalidateQueries({ queryKey: ['organisations'] }) queryClient.invalidateQueries({ queryKey: ['organisations', variables.id] }) + queryClient.invalidateQueries({ queryKey: ['organisation-dashboard-stats', variables.id] }) }, }) } + +export function useOrganisationDashboardStats(id: Ref) { + return useQuery({ + queryKey: ['organisation-dashboard-stats', id], + queryFn: async () => { + const { data } = await apiClient.get>(`/organisations/${id.value}/dashboard-stats`) + return data.data + }, + enabled: () => !!id.value, + }) +} diff --git a/apps/app/src/pages/organisation/index.vue b/apps/app/src/pages/organisation/index.vue index 7f6df3d7..b457b2b2 100644 --- a/apps/app/src/pages/organisation/index.vue +++ b/apps/app/src/pages/organisation/index.vue @@ -1,12 +1,21 @@ @@ -34,13 +100,13 @@ function formatDate(iso: string) {
@@ -48,7 +114,7 @@ function formatDate(iso: string) {