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

API v2 paginated tasks #699

Open
10 tasks done
c8y3 opened this issue Jan 24, 2025 · 1 comment · May be fixed by #705
Open
10 tasks done

API v2 paginated tasks #699

c8y3 opened this issue Jan 24, 2025 · 1 comment · May be fixed by #705
Assignees
Labels
enhancement New feature or request

Comments

@c8y3
Copy link
Contributor

c8y3 commented Jan 24, 2025

Implement endpoint GET /api/v2/cases/{case_identifier}/tasks to get a paginated list of tasks:

  • successful GET should return 200
  • field data should be present
  • fields data should be [] when there is no tasks
  • field total should return 1 when there is a task
  • it should accept page, per_page, order_by and sort_dir parameters
  • fields last_page, current_page and next_page should be present in result
  • check returned object is uniform with other endpoints
  • deprecate GET /case/tasks/list
  • openapi document GET /api/v2/cases/{case_identifier}/tasks
  • openapi deprecate GET /case/tasks/list
@c8y3 c8y3 added the enhancement New feature or request label Jan 24, 2025
@c8y3 c8y3 self-assigned this Jan 24, 2025
@c8y3
Copy link
Contributor Author

c8y3 commented Jan 29, 2025

Some tasks to do:

  • use object PaginationParameter and factor code for Cases and Iocs
  • introduce a method at the business level rather than going directly to the database
  • factor this line (or variants) everywhere order_func = desc if pagination_parameters.get_direction() == 'desc' else asc
  • check the return values of the task, use the correct schema object
  • factor construction of paginated result with other similar endpoints

@c8y3 c8y3 linked a pull request Jan 31, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant