diff --git a/api/v1/shortcut.go b/api/v1/shortcut.go index b1f8e50..c5f3dbc 100644 --- a/api/v1/shortcut.go +++ b/api/v1/shortcut.go @@ -168,8 +168,15 @@ func (s *APIV1Service) registerShortcutRoutes(g *echo.Group) { } find := &store.FindShortcut{} - if name := c.QueryParam("name"); name != "" { - find.Name = &name + if creatorIDStr := c.QueryParam("creatorId"); creatorIDStr != "" { + 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{}