From 31f7c53533a7e864ca439ef0a91b1ae2947ccf8d Mon Sep 17 00:00:00 2001 From: Yorick de Wid Date: Tue, 13 Aug 2024 11:08:46 +0200 Subject: [PATCH] Refactor mapset retrieval to include organization information --- .../Repositories/MapsetRepository.cs | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/FunderMaps.Data/Repositories/MapsetRepository.cs b/src/FunderMaps.Data/Repositories/MapsetRepository.cs index bb4bf12c..c4c89ef1 100644 --- a/src/FunderMaps.Data/Repositories/MapsetRepository.cs +++ b/src/FunderMaps.Data/Repositories/MapsetRepository.cs @@ -27,9 +27,9 @@ public async Task GetPublicAsync(string id) c.consent, c.note, c.icon, - c.fence_neighborhood, - c.fence_district, - c.fence_municipality, + NULL::text AS fence_neighborhood, + NULL::text AS fence_district, + NULL::text AS fence_municipality, c.order, c.layerset FROM maplayer.mapset_collection AS c @@ -67,9 +67,9 @@ public async Task GetPublicByNameAsync(string name) c.consent, c.note, c.icon, - c.fence_neighborhood, - c.fence_district, - c.fence_municipality, + NULL::text AS fence_neighborhood, + NULL::text AS fence_district, + NULL::text AS fence_municipality, c.order, c.layerset FROM maplayer.mapset_collection AS c @@ -104,13 +104,14 @@ public async IAsyncEnumerable GetByOrganizationIdAsync(Guid id) c.consent, c.note, c.icon, - c.fence_neighborhood, - c.fence_district, - c.fence_municipality, + o.fence_neighborhood, + o.fence_district, + o.fence_municipality, c.order, c.layerset FROM maplayer.mapset_collection AS c JOIN maplayer.map_organization mo ON mo.map_id = c.id + JOIN organization.organization AS o ON o.id = mo.organization_id WHERE mo.organization_id = @id AND c.public = false ORDER BY c.order ASC";