feat: update memo visibility in frontend

This commit is contained in:
boojack
2022-07-08 23:38:24 +08:00
parent 697d01e306
commit 1afc183458
11 changed files with 72 additions and 19 deletions

View File

@ -76,6 +76,13 @@ func (s *Server) registerMemoRoutes(g *echo.Group) {
memoFind.CreatorID = &userID
}
// Only can get PUBLIC memos in visitor mode
_, ok := c.Get(getUserIDContextKey()).(int)
if !ok {
publicVisibility := api.Public
memoFind.Visibility = &publicVisibility
}
rowStatus := api.RowStatus(c.QueryParam("rowStatus"))
if rowStatus != "" {
memoFind.RowStatus = &rowStatus