Commit b0db123
authored
Fix: Adjust pagination metadata when fetching projects with an assignee filter (#18)
### Description
This PR fixes a pagination bug in the `projects list` command.
Previously, when using filters that required fetching all pages and
processing them locally (e.g., filtering by `assignee`), the command
still parsed the raw API metadata for `totalPages` and `totalCount`.
This led to a misleading summary indicating many pages (like "Page
1/36") even when the local filtering only returned a handful of results
that fit completely on a single page.
The output logic has been updated so that when `fetch_all` is triggered,
the displayed "total pages" and "total items" are correctly calculated
from the localized result set.
### How to Test
1. Run `python -m conviso.app projects list --company-id <ID> --filter
assignee=<EMAIL>`.
2. Observe the output summary in the footer and title.
3. **Expected behavior:** The pagination metrics should represent the
exact number of matching projects found and should display as `page 1/1`
rather than retaining the unfiltered total counts from the initial API
metadata.
4. Run without the assignee filter and verify that normal pagination
limits remain standard and unbroken.2 files changed
Lines changed: 21 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
206 | 206 | | |
207 | 207 | | |
208 | 208 | | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
209 | 221 | | |
210 | 222 | | |
211 | 223 | | |
212 | 224 | | |
213 | 225 | | |
214 | | - | |
| 226 | + | |
215 | 227 | | |
216 | 228 | | |
217 | 229 | | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | | - | |
222 | | - | |
223 | | - | |
224 | | - | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
225 | 236 | | |
226 | 237 | | |
227 | 238 | | |
228 | 239 | | |
229 | | - | |
| 240 | + | |
230 | 241 | | |
231 | 242 | | |
232 | 243 | | |
| |||
0 commit comments