Add paging headers (#36521)
Adds support for paging in admin/hooks api endpoint fixes: https://github.com/go-gitea/gitea/issues/36516 --------- Co-authored-by: techknowlogick <techknowlogick@gitea.com> Co-authored-by: techknowlogick <matti@mdranta.net>
This commit is contained in:
@@ -23,8 +23,9 @@ import (
|
||||
|
||||
// ListOwnerHooks lists the webhooks of the provided owner
|
||||
func ListOwnerHooks(ctx *context.APIContext, owner *user_model.User) {
|
||||
listOptions := GetListOptions(ctx)
|
||||
opts := &webhook.ListWebhookOptions{
|
||||
ListOptions: GetListOptions(ctx),
|
||||
ListOptions: listOptions,
|
||||
OwnerID: owner.ID,
|
||||
}
|
||||
|
||||
@@ -42,7 +43,7 @@ func ListOwnerHooks(ctx *context.APIContext, owner *user_model.User) {
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
ctx.SetLinkHeader(int(count), listOptions.PageSize)
|
||||
ctx.SetTotalCountHeader(count)
|
||||
ctx.JSON(http.StatusOK, apiHooks)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user