diff --git a/apps/back-end/src/routes.ts b/apps/back-end/src/routes.ts index 40eaa87d..cafbb8a2 100644 --- a/apps/back-end/src/routes.ts +++ b/apps/back-end/src/routes.ts @@ -85,11 +85,11 @@ export function MykomapRouter( // Construct and return the implementation object return { - async getDataset({ params: { datasetId }, request, reply }) { + async getDatasetLocations({ params: { datasetId }, request, reply }) { // Validate the parameters some more if (!sendJson(request, reply, filePath("datasets", datasetId))) - throw new TsRestResponseError(contract.getDataset, { + throw new TsRestResponseError(contract.getDatasetLocations, { status: 404, body: { message: `unknown datasetId '${datasetId}'` }, }); @@ -141,7 +141,7 @@ export function MykomapRouter( // Validate the parameters some more if (!sendJson(request, reply, filePath("datasets", datasetId, "config"))) - throw new TsRestResponseError(contract.getDataset, { + throw new TsRestResponseError(contract.getConfig, { status: 404, body: { message: `unknown datasetId '${datasetId}'` }, }); diff --git a/apps/back-end/test/plugin.test.ts b/apps/back-end/test/plugin.test.ts index f43a3bae..851db9b9 100644 --- a/apps/back-end/test/plugin.test.ts +++ b/apps/back-end/test/plugin.test.ts @@ -17,7 +17,7 @@ const opts: MykomapRouterConfig = { // // Operation: dataset -// URL: /dataset/:datasetId +// URL: /dataset/:datasetId/locations // summary: obtains a dataset // req.params // type: object @@ -54,7 +54,7 @@ test("testing dataset", async (t) => { const res = await fastify.inject({ method: "GET", - url: "/dataset/test-A", + url: "/dataset/test-A/locations", payload: undefined, headers: undefined, });