fix: frontend query
This commit is contained in:
@@ -9,7 +9,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type ListQuery struct {
|
type ListQuery struct {
|
||||||
keyword *string `query:"keyword"`
|
Keyword *string `query:"keyword"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// @provider
|
// @provider
|
||||||
@@ -20,7 +20,7 @@ type posts struct{}
|
|||||||
// @Bind pagination query
|
// @Bind pagination query
|
||||||
// @Bind query query
|
// @Bind query query
|
||||||
func (ctl *posts) List(ctx fiber.Ctx, pagination *requests.Pagination, query *ListQuery) (*requests.Pager, error) {
|
func (ctl *posts) List(ctx fiber.Ctx, pagination *requests.Pagination, query *ListQuery) (*requests.Pager, error) {
|
||||||
cond := models.Posts.BuildConditionWithKey(query.keyword)
|
cond := models.Posts.BuildConditionWithKey(query.Keyword)
|
||||||
return models.Posts.List(ctx.Context(), pagination, cond)
|
return models.Posts.List(ctx.Context(), pagination, cond)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user