Commit graph

27 commits

Author SHA1 Message Date
Anton Khorev
0bd5838f51 Respond with plaintext when user not found in changeset query
The response used to be of type xml with empty body, which is not valid xml.
2023-08-19 20:26:13 +03:00
Anton Khorev
5016defff0 Add 'from' and 'to' changeset query parameters 2023-08-15 19:29:06 +03:00
Anton Khorev
86f254380b Revert misleading comment about time restriction
Was added in afe8dd51ec (diff-22d3daaccac3ac960d6dbb47e9c6a9d15b0b4cffbbf9ad32d525600f562827f1R420)
2023-08-15 19:29:06 +03:00
Anton Khorev
7bca06a3d3 Disallow changesets query with both time and order=oldest 2023-08-15 19:29:06 +03:00
Anton Khorev
b350c78bc8 Sort changesets by creation time 2023-08-15 19:29:06 +03:00
Tom Hughes
702c071e19 Sort changesets by close time to match selection
This ensures that the sort can be optimised using the index
when selecting by time.
2023-08-13 19:09:54 +01:00
Anton Khorev
0abab48f5d Add order parameter to changeset query api entry point 2023-08-12 03:57:48 +03:00
Anton Khorev
a5d14a1815 Move changeset query limit values to settings 2023-08-08 03:33:04 +03:00
Anton Khorev
e286ce515c Add limit parameter to api changesets query 2023-02-14 20:56:29 +03:00
Andy Allan
22946d703a Enable the ActionOrder cop for remaining controllers
Where actions were reordered, the rails standard actions were
also moved to the top of each controller.
2022-11-02 11:06:00 +00:00
Tom Hughes
7f619c6484 Check API status before authorizing access
Fixes #3530
2022-04-11 20:47:52 +01:00
mmd-osm
4ec85171fd JSON output added to changeset(s) endpoints 2022-03-14 15:52:49 +01:00
Tom Hughes
b5f06e06c1 Fix rubocop Rails/TimeZone warnings 2022-03-01 22:55:10 +00:00
Andy Allan
76f1d7bc78 Use a builder to render changeset downloads 2021-09-15 16:33:04 +01:00
Tom Hughes
ff3a30d245 Fix new rubocop warnings 2021-03-02 08:24:15 +00:00
Tom Hughes
0654be27f9 Fix new rubocop warnings 2021-01-11 19:17:31 +00:00
Tom Hughes
582402ba8f Prefer keyword arguments when method has optional boolean arguments 2020-11-13 10:22:55 +00:00
Andy Allan
8c326a6c1f Remove unnecessary layout calls from api controllers
These were left over from the refactoring of the controllers into api and non-api versions.
2020-07-08 18:51:27 +02:00
mmd-osm
fc8923c305 Remove expand_bbox endpoint 2019-11-09 21:08:40 +01:00
Tom Hughes
135ec35a91 Fix numericality validation to use correct integer only constraint
Fixes #2355
2019-08-22 12:14:06 +01:00
Tom Hughes
9f57f60b87 Fix new rubocop warnings 2019-04-23 09:33:34 +01:00
Andy Allan
dad36f2fca Use a lambda in order to pass parameters in before_actions
This avoid calling methods on a new instance of the controller, and
therefore allows these methods to be marked as private.

As a bonus, rubocop can now parse them and warn when they refer to
actions that don't exist in the controller.
2019-03-20 15:08:36 +01:00
Andy Allan
742291a840 Simplify deny_access handling
Now that we have all api controllers inheriting from a common base,
it's easier to override the deny_access handler without having to
switch between both.

Fixes #2064
2019-03-20 14:39:17 +01:00
Andy Allan
3bb07e29ec Refactor api controllers to inherit from a common ApiController 2019-03-20 14:16:15 +01:00
Andy Allan
656ed0af76 Move changeset builder views to the api namespace 2019-03-16 15:30:41 +00:00
Frederik Ramm
538bfed8a6 Move changeset XML generation to a view 2019-03-16 15:30:18 +00:00
Andy Allan
1778fa3d9c Move the api methods from changesets_controller into the api namespaced controller 2019-02-24 12:18:31 +01:00