Skip to content

Commit

Permalink
Refactor mapset retrieval to include organization information
Browse files Browse the repository at this point in the history
  • Loading branch information
yorickdewid committed Aug 13, 2024
1 parent c11a446 commit 31f7c53
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions src/FunderMaps.Data/Repositories/MapsetRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ public async Task<Mapset> 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
Expand Down Expand Up @@ -67,9 +67,9 @@ public async Task<Mapset> 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
Expand Down Expand Up @@ -104,13 +104,14 @@ public async IAsyncEnumerable<Mapset> 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";
Expand Down

0 comments on commit 31f7c53

Please sign in to comment.