chore: update find shortcut

This commit is contained in:
Steven 2023-06-23 12:33:46 +08:00
parent 5785b50c62
commit f3c758ff22

View File

@ -168,8 +168,15 @@ func (s *APIV1Service) registerShortcutRoutes(g *echo.Group) {
} }
find := &store.FindShortcut{} find := &store.FindShortcut{}
if name := c.QueryParam("name"); name != "" { if creatorIDStr := c.QueryParam("creatorId"); creatorIDStr != "" {
find.Name = &name creatorID, err := strconv.Atoi(creatorIDStr)
if err != nil {
return echo.NewHTTPError(http.StatusBadRequest, "Unwanted creator id string")
}
find.CreatorID = &creatorID
}
if tag := c.QueryParam("tag"); tag != "" {
find.Tag = &tag
} }
list := []*store.Shortcut{} list := []*store.Shortcut{}