Commit c7d9c89
authored
fix: allow closing draft CLs and fix draft list ordering (#1982)
* fix: allow closing draft CLs and fix draft list ordering
- Allow /api/v1/cl/{link}/close to close both Open and Draft change lists so draft CLs can be closed from the UI
- Remove default ORDER BY id ASC in CL list query and respect created_at/updated_at sorting
- Ensure newly created draft CLs appear on the first page when sorted by latest creation time
Signed-off-by: Hongze Gao <15101764808@163.com>
* fix: make CL list fallback sort deterministic
- Ensure CL list falls back to ORDER BY id DESC when no valid sort field is provided
- Treat unknown sort_by values the same as missing ones to keep pagination stable
- Preserve created_at/updated_at based ordering when a recognized sort field is passed
Signed-off-by: Hongze Gao <15101764808@163.com>
* fix: format cl_storage.rs with cargo fmt
Signed-off-by: Hongze Gao <15101764808@163.com>
---------
Signed-off-by: Hongze Gao <15101764808@163.com>1 parent 78e5d03 commit c7d9c89
2 files changed
Lines changed: 10 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
103 | | - | |
104 | | - | |
| 103 | + | |
105 | 104 | | |
106 | 105 | | |
107 | 106 | | |
108 | 107 | | |
109 | 108 | | |
110 | | - | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
111 | 117 | | |
112 | 118 | | |
113 | 119 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
111 | | - | |
| 111 | + | |
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
| |||
0 commit comments