oncall-engine/engine/common
Joey Orlando 767c5352fa
augment API response pagination attributes (#2471)
# What this PR does

This PR:
- adds a few attributes to paginated API responses
- removes channel filter "send demo alert" internal API endpoint + tests
(this endpoint was marked as deprecated + not consumed by the web UI)

With the new paginated API response schema, the web UI will no longer
need to:
- hardcode `ITEMS_PER_PAGE` for each table
- manually calculate total number of pages

(these two things ☝️ will be done in
https://github.com/grafana/oncall/issues/2476)

For `GET /api/internal/v1/alertgroups` the response will now look like
this:
```diff
{
    "next": <url> | None,
    "previous": <url> | None,
    "results": [],
++  "page_size": <int>
}
```

For all other paginated API responses, the response will now look like:
```diff
{
    "count": <int>,
    "next": <url> | None,
    "previous": <url> | None,
    "results": [],
++  "page_size": <int>,
++  "current_page_number": <int>,
++  "total_pages": <int>
}
```

## TODO
- [x] update public API docs to include these new attributes

## Checklist

- [x] Unit, integration, and e2e (if applicable) tests updated
- [x] Documentation added (or `pr:no public docs` PR label added if not
required)
- [x] `CHANGELOG.md` updated (or `pr:no changelog` PR label added if not
required)
2023-07-14 11:19:40 -04:00
..
api_helpers augment API response pagination attributes (#2471) 2023-07-14 11:19:40 -04:00
constants add several new database columns + emit two new Django signals (#1522) 2023-04-14 09:15:57 +02:00
custom_celery_tasks World, meet OnCall! 2022-06-03 08:09:47 -06:00
exceptions Send demo alert with dynamic payload and get demo payload example on private api (#1700) 2023-04-18 02:48:11 +00:00
insight_log continue addressing mypy violations (#2170) 2023-06-27 10:23:08 +00:00
jinja_templater Added preview and migration API endpoints for route migration from regex into jinja2 (#1715) 2023-04-18 02:53:53 +00:00
oncall_gateway Slack team connector v2 (#1581) 2023-03-28 03:27:45 +00:00
recaptcha Add validation of hostname for recapctha (#1445) 2023-03-06 08:59:48 +00:00
tests Fix cuddled list Markdown issue (#2488) 2023-07-11 09:14:52 +00:00
__init__.py World, meet OnCall! 2022-06-03 08:09:47 -06:00
admin.py continue addressing mypy violations (#2170) 2023-06-27 10:23:08 +00:00
database.py Fix Grafana teams sync (#1652) 2023-03-28 18:26:24 +00:00
l10n.py add user locale field to mobile app user settings table + change going on call push notification text (#2131) 2023-06-14 12:19:58 -04:00
public_primary_keys.py Insight logs (#348) 2022-08-24 12:04:44 +05:00
timezones.py centralize timezone validation + add serializer validation for on call shifts and schedules (#924) 2022-12-01 14:13:39 +01:00
utils.py Fix cuddled list Markdown issue (#2488) 2023-07-11 09:14:52 +00:00