fix: visibility param override the user auth state (#1941)

fix visibility param override the user auth state
This commit is contained in:
Athurg Gooth 2023-07-13 14:56:43 +08:00 committed by GitHub
parent d8b6e92813
commit 11aa01ee2e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -541,14 +541,6 @@ func (s *APIV1Service) registerMemoRoutes(g *echo.Group) {
}
findMemoMessage.ContentSearch = contentSearch
visibilityListStr := c.QueryParam("visibility")
if visibilityListStr != "" {
visibilityList := []store.Visibility{}
for _, visibility := range strings.Split(visibilityListStr, ",") {
visibilityList = append(visibilityList, store.Visibility(visibility))
}
findMemoMessage.VisibilityList = visibilityList
}
if limit, err := strconv.Atoi(c.QueryParam("limit")); err == nil {
findMemoMessage.Limit = &limit
}