gitea/routers
Gregorius Bima Kharisma Wicaksana b6ffe0e4e9
refactor: extract helper functions from SearchIssues (#36158)
## Summary

This PR refactors the `SearchIssues` function in
`routers/api/v1/repo/issue.go` by extracting common logic into reusable
helper functions:

- `parseIssueIsClosed()`: Parses the "state" query parameter and returns
the corresponding `isClosed` option
- `parseIssueIsPull()`: Parses the "type" query parameter and returns
the corresponding `isPull` option
- `buildSearchIssuesRepoIDs()`: Builds the list of repository IDs for
issue search based on query parameters

### Benefits:
- Improved code readability
- Smaller, more focused functions
- Easier to test individual components
- Potential for reuse in other handlers

### Changes:
- Extracted 3 helper functions from the ~292 line `SearchIssues`
function
- No functional changes - behavior remains the same
- Proper error handling preserved

## Test plan
- [ ] Verify existing API tests pass
- [ ] Manual testing of `/repos/issues/search` endpoint

Ref: #35015

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-12-20 17:57:41 -08:00
..
api refactor: extract helper functions from SearchIssues (#36158) 2025-12-20 17:57:41 -08:00
common refactor: extract helper functions from SearchIssues (#36158) 2025-12-20 17:57:41 -08:00
install Fix oauth2 session gob register (#36017) 2025-11-26 23:25:34 +08:00
private Fix the bug when ssh clone with redirect user or repository (#36039) 2025-12-04 19:17:49 +00:00
utils Refactor older tests to use testify (#33140) 2025-01-09 09:21:47 +08:00
web refactor: extract helper functions from SearchIssues (#36158) 2025-12-20 17:57:41 -08:00
init.go Use global lock instead of status pool for cron lock (#35507) 2025-09-27 10:11:52 -07:00