Refactor layer API endpoint and database functions.

- A single get() function is used both to list all available
  layers, if no layer name is given, or a single layer.
- The database no longer holds the actual layer contents,
  only the path to the layer file(s), so the list() function
  is now redundant as we return the full payload in every case.
- The /gis/layer and /gis/layer/:name endpoints now have the same
  payload structure.
This commit is contained in:
D. Berge
2023-09-12 11:10:00 +02:00
parent f9a70e0145
commit 707889be42
7 changed files with 16 additions and 50 deletions

View File

@@ -124,7 +124,7 @@ app.map({
get: [ mw.gis.project.final ]
},
'/project/:project/gis/layer': {
get: [ mw.etag.noSave, mw.gis.project.layer.list ]
get: [ mw.etag.noSave, mw.gis.project.layer.get ]
},
'/project/:project/gis/layer/:name': {
get: [ mw.etag.noSave, mw.gis.project.layer.get ]