koderover / zadig

Zadig is a cloud native, distributed, developer-oriented DevOps platform
https://koderover.com
Other
2.76k stars 819 forks source link

feat: add sorting option to project list API #3644

Closed leozhang2018 closed 3 months ago

leozhang2018 commented 3 months ago

What this PR does / Why we need it:

This PR adds a new parameter SortByUpdatedAt to control whether the project list should be sorted by the UpdatedAt field, supporting both ascending and descending order.

What is changed and how it works?

  1. Added the SortByUpdatedAt field to the ProjectListOptions struct.
  2. Modified the getProjects function to sort the project list based on the SortByUpdatedAt field:
    • If SortByUpdatedAt is "asc", the list is sorted in ascending order by UpdatedAt.
    • If SortByUpdatedAt is "desc", the list is sorted in descending order by UpdatedAt.

      Does this PR introduce a user-facing change?