2
0
mirror of https://github.com/go-gitea/gitea.git synced 2025-03-07 20:08:24 +08:00
gitea/modules
qwerty287 9d943bf374
Add missing X-Total-Count and fix some related bugs ()
* Add missing `X-Total-Count` and fix some related bugs

Adds `X-Total-Count` header to APIs that return a list but doesn't have it yet.
Fixed bugs:
* not returned after reporting error (39eb82446c/routers/api/v1/user/star.go (L70))
* crash with index out of bounds, API issue/issueSubscriptions

I also found various endpoints that return lists but do not apply/support pagination yet:
```
/repos/{owner}/{repo}/issues/{index}/labels
/repos/{owner}/{repo}/issues/comments/{id}/reactions
/repos/{owner}/{repo}/branch_protections
/repos/{owner}/{repo}/contents
/repos/{owner}/{repo}/hooks/git
/repos/{owner}/{repo}/issue_templates
/repos/{owner}/{repo}/releases/{id}/assets
/repos/{owner}/{repo}/reviewers
/repos/{owner}/{repo}/teams
/user/emails
/users/{username}/heatmap
```
If this is not expected, an new issue should be opened.

Closes 

* fmt

* Update routers/api/v1/repo/issue_subscription.go

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>

* Use FindAndCount

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
Co-authored-by: 6543 <6543@obermui.de>
2021-12-15 13:39:34 +08:00
..
activitypub
analyze
appstate
auth
avatar
base
cache Test cache during init () 2021-12-06 00:24:57 +08:00
charset
context Improve behavior of "Fork" button () 2021-12-13 09:59:09 +08:00
convert Some repository refactors () 2021-12-12 23:48:20 +08:00
csv
doctor Move keys to models/asymkey () 2021-12-10 16:14:24 +08:00
emoji
eventsource
generate
git Improve checkBranchName () 2021-12-08 19:08:16 +00:00
gitgraph Add missing X-Total-Count and fix some related bugs () 2021-12-15 13:39:34 +08:00
graceful
hcaptcha
highlight
hostmatcher
httpcache
httplib
indexer Add missing X-Total-Count and fix some related bugs () 2021-12-15 13:39:34 +08:00
json Move repository model into models/repo () 2021-12-10 09:27:50 +08:00
lfs
log
markup Fix markdown URL parsing () 2021-12-11 19:21:36 +02:00
metrics
migration Use fmt.Sprintf correctly () 2021-12-02 20:36:50 +01:00
nosql
notification Some repository refactors () 2021-12-12 23:48:20 +08:00
options
password
pprof
private Move keys to models/asymkey () 2021-12-10 16:14:24 +08:00
process Make Requests Processes and create process hierarchy. Associate OpenRepository with context. () 2021-11-30 20:06:32 +00:00
proxy
public
queue
recaptcha
references
repository Some repository refactors () 2021-12-12 23:48:20 +08:00
secret
session
setting allways set a message-id on mails () 2021-12-08 15:34:23 +08:00
ssh Move keys to models/asymkey () 2021-12-10 16:14:24 +08:00
storage
structs Add migrate from Codebase () 2021-12-02 23:24:02 +01:00
svg
sync
templates Add Option to synchronize Admin & Restricted states from OIDC/OAuth2 along with Setting Scopes () 2021-12-14 16:37:11 +08:00
test Move repository model into models/repo () 2021-12-10 09:27:50 +08:00
timeutil
translation
typesniffer
updatechecker
upload Replace regex usage for MIME parsing () 2021-11-27 19:12:43 +08:00
uri
user
util Fix a panic in NotifyCreateIssueComment (caused by string truncation) () 2021-12-09 05:41:17 +00:00
validation
web