Skip to content

Commit

Permalink
[back-end] rename getDataset as getDatasetLocations
Browse files Browse the repository at this point in the history
Tests pass
  • Loading branch information
Nick Stokoe committed Oct 28, 2024
1 parent 50b0974 commit 792bf86
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions apps/back-end/src/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}'` },
});
Expand Down Expand Up @@ -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}'` },
});
Expand Down
4 changes: 2 additions & 2 deletions apps/back-end/test/plugin.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const opts: MykomapRouterConfig = {

//
// Operation: dataset
// URL: /dataset/:datasetId
// URL: /dataset/:datasetId/locations
// summary: obtains a dataset
// req.params
// type: object
Expand Down Expand Up @@ -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,
});
Expand Down

0 comments on commit 792bf86

Please sign in to comment.