feat: Add Search to Releases Page

This commit is contained in:
JakobDev 2024-11-02 10:24:35 +01:00
parent e5e2860221
commit 86546fe63e
No known key found for this signature in database
GPG key ID: 39DEF62C3ED6DC4C
7 changed files with 69 additions and 3 deletions

View file

@ -136,6 +136,10 @@ func ListReleases(ctx *context.APIContext) {
// in: query
// description: filter (exclude / include) pre-releases
// type: boolean
// - name: q
// in: query
// description: Search string
// type: string
// - name: page
// in: query
// description: page number of results to return (1-based)
@ -158,6 +162,7 @@ func ListReleases(ctx *context.APIContext) {
IsDraft: ctx.FormOptionalBool("draft"),
IsPreRelease: ctx.FormOptionalBool("pre-release"),
RepoID: ctx.Repo.Repository.ID,
Keyword: ctx.FormTrim("q"),
}
releases, err := db.Find[repo_model.Release](ctx, opts)