Skip to content

Commit

Permalink
Merge pull request #58 from basenana/docs/pg
Browse files Browse the repository at this point in the history
fix: filter unread and mark
  • Loading branch information
zwwhdls authored Dec 16, 2024
2 parents ed69846 + 236bb6b commit bd105fc
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions api/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,6 @@ func getFilterQuery(c *gin.Context) *doc.DocumentFilter {
Search: c.Query("search"),
FuzzyName: c.Query("fuzzyName"),
Source: c.Query("source"),
Marked: utils.ToPtr(c.Query("mark") == "true"),
Unread: utils.ToPtr(c.Query("unRead") == "true"),
Page: int64(page),
PageSize: int64(pageSize),
Order: doc.DocumentOrder{
Expand All @@ -152,6 +150,12 @@ func getFilterQuery(c *gin.Context) *doc.DocumentFilter {
},
}

if c.Query("mark") != "" {
docQuery.Marked = utils.ToPtr(c.Query("mark") == "true")
}
if c.Query("unRead") != "" {
docQuery.Unread = utils.ToPtr(c.Query("unRead") == "true")
}
parentId := c.Query("parentId")
if parentId != "" {
pId, err := strconv.Atoi(c.Query("parentId"))
Expand Down

0 comments on commit bd105fc

Please sign in to comment.