Skip to content

armgit / memos

Public Imported from GitHub
0

Memos is an open-source, self-hosted note-taking app that brings your everyday thoughts together in a personal timeline. Your data stays yours, and you choose what to keep private or share.

fix: get all memo api (#2091)

boojack5d5d8de9feb2
diff --git a/api/v1/memo.go b/api/v1/memo.go
index ff01c8946..ff1410bba 100644
--- a/api/v1/memo.go
+++ b/api/v1/memo.go
@@ -531,30 +531,13 @@ func (s *APIV1Service) registerMemoRoutes(g *echo.Group) {
g.GET("/memo/all", func(c echo.Context) error {
ctx := c.Request().Context()
findMemoMessage := &store.FindMemo{}
- _, ok := c.Get(auth.UserIDContextKey).(int)
+ _, ok := c.Get(auth.UserIDContextKey).(int32)
if !ok {
findMemoMessage.VisibilityList = []store.Visibility{store.Public}
} else {
findMemoMessage.VisibilityList = []store.Visibility{store.Public, store.Protected}
}
- pinnedStr := c.QueryParam("pinned")
- if pinnedStr != "" {
- pinned := pinnedStr == "true"
- findMemoMessage.Pinned = &pinned
- }
-
- contentSearch := []string{}
- tag := c.QueryParam("tag")
- if tag != "" {
- contentSearch = append(contentSearch, "#"+tag+" ")
- }
- contentSlice := c.QueryParams()["content"]
- if len(contentSlice) > 0 {
- contentSearch = append(contentSearch, contentSlice...)
- }
- findMemoMessage.ContentSearch = contentSearch
-
if limit, err := strconv.Atoi(c.QueryParam("limit")); err == nil {
findMemoMessage.Limit = &limit
}