mirror of
https://github.com/aykhans/slash-e.git
synced 2025-04-18 21:19:44 +00:00
chore: update find shortcut
This commit is contained in:
parent
5785b50c62
commit
f3c758ff22
@ -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{}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user