Skip to content

Commit

Permalink
Merge branch 'main' into go_update
Browse files Browse the repository at this point in the history
  • Loading branch information
mattwoberts authored Jul 10, 2024
2 parents f025099 + c9e0674 commit 904768c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/handlers/apiv1/post.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,13 @@ import (
// SearchPosts return existing posts based on search criteria
func SearchPosts() web.HandlerFunc {
return func(c *web.Context) error {
viewQueryParams := c.QueryParam("view")
if viewQueryParams == "" {
viewQueryParams = "all" // Set default value to "all" if not provided
}
searchPosts := &query.SearchPosts{
Query: c.QueryParam("query"),
View: c.QueryParam("view"),
View: viewQueryParams,
Limit: c.QueryParam("limit"),
Tags: c.QueryParamAsArray("tags"),
}
Expand Down

0 comments on commit 904768c

Please sign in to comment.