Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Map config delete broken in NodeJS legacy API v1 #1412

Closed
sweco-semara opened this issue Oct 5, 2023 · 1 comment · Fixed by #1413
Closed

Map config delete broken in NodeJS legacy API v1 #1412

sweco-semara opened this issue Oct 5, 2023 · 1 comment · Fixed by #1413
Assignees
Labels
bug module:backend MapService stuff
Milestone

Comments

@sweco-semara
Copy link
Contributor

Describe the bug
Map configuration cannot be deleted with NodeJS back-end using API v1.

Since #1309 and the introduction of OpenAPI specifications, commit 48a4c8a cleans up v2 API-introduced HTTP PUT and HTTP DELETE but accidentally also removes the HTTP GET legacy method. Resulting state is that NodeJS back-end API v1 cannot delete map configurations at all.

To Reproduce
Steps to reproduce the behavior:

  1. Set up a Hajk installation with NodeJS back-end
  2. Configure Hajk admin config.json mapsettings.url_map_delete = "/api/v1/mapconfig/delete"
  3. Use admin to create a new map config
  4. Try to delete the new map config
  5. Back-end always returns HTTP/404 not found on the GET to /api/v1/mapconfig/delete/:name

Expected behavior
Expect step 5 result: backend service delegates request to Express router apis\v1\controllers\mapconfig\router.js which in turns map the calls to the ConfigService/config.service.js deleteMap() method.

@sweco-semara sweco-semara added bug module:backend MapService stuff labels Oct 5, 2023
@sweco-semara sweco-semara self-assigned this Oct 5, 2023
@sweco-semara
Copy link
Contributor Author

Seems the HTTP method clean-up from OpenAPI spec v1 in 48a4c8a accidentally left the HTTP PUT for mapconfig create endpoint but instead removed HTTP GET for mapconfig delete. Fix is a minor adjust of the OpenAPI spec YAML. Also the v1 router can be cleaned from non-existing v2 new HTTP verbs now that the separation of routers is completed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug module:backend MapService stuff
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants