[openstreetmap/openstreetmap-website] API element resources - redaction paths (PR #5656)
Anton Khorev
notifications at github.com
Tue Feb 11 23:12:51 UTC 2025
The last non-resourceful thing in the elements api are redactions. They are mapped to `redact` actions and `redact` is not a standard name. One option would be to map them to `destroy` actions of element versions, but they can also remove redactions and removing redactions with `destroy` is going to look strange. Instead this PR adds `redaction` resources with `create` and `destroy` actions. `create` adds a redaction to an element version, `destroy` removes a redaction. For backwards compatibility `create` also removes redactions when none is supplied in parameters because the old `node/:node_id/:version/redact`, `way/:way_id/:version/redact` and `relation/:relation_id/:version/redact` are also mapped to `create` action on `redaction` resources.
You can view, comment on, or merge this pull request online at:
https://github.com/openstreetmap/openstreetmap-website/pull/5656
-- Commit Summary --
* Add base old element redactions controller
* Create node version redaction resource
* Create way version redaction resource
* Create relation version redaction resource
* Remove unused redaction code from api old elements controller
* Remove unnecessary RuboCop exclusion
-- File Changes --
M .rubocop.yml (1)
M app/abilities/api_ability.rb (2)
A app/controllers/api/old_elements/redactions_controller.rb (29)
M app/controllers/api/old_elements_controller.rb (23)
A app/controllers/api/old_nodes/redactions_controller.rb (11)
A app/controllers/api/old_relations/redactions_controller.rb (11)
A app/controllers/api/old_ways/redactions_controller.rb (11)
M config/routes.rb (21)
A test/controllers/api/old_nodes/redactions_controller_test.rb (160)
M test/controllers/api/old_nodes_controller_test.rb (127)
A test/controllers/api/old_redactions/redactions_controller_test.rb (160)
M test/controllers/api/old_relations_controller_test.rb (127)
A test/controllers/api/old_ways/redactions_controller_test.rb (160)
M test/controllers/api/old_ways_controller_test.rb (127)
-- Patch Links --
https://github.com/openstreetmap/openstreetmap-website/pull/5656.patch
https://github.com/openstreetmap/openstreetmap-website/pull/5656.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/5656
You are receiving this because you are subscribed to this thread.
Message ID: <openstreetmap/openstreetmap-website/pull/5656 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20250211/e348cfa0/attachment-0001.htm>
More information about the rails-dev
mailing list