mirror of
https://github.com/usememos/memos.git
synced 2025-06-05 22:09:59 +02:00
chore: fix linter warning
This commit is contained in:
@@ -110,6 +110,13 @@ func (s *APIV1Service) ListMemos(ctx context.Context, request *v1pb.ListMemosReq
|
|||||||
memoFind.CreatorID = &userID
|
memoFind.CreatorID = &userID
|
||||||
memoFind.OrderByPinned = true
|
memoFind.OrderByPinned = true
|
||||||
}
|
}
|
||||||
|
if request.State == v1pb.State_ARCHIVED {
|
||||||
|
state := store.Archived
|
||||||
|
memoFind.RowStatus = &state
|
||||||
|
} else {
|
||||||
|
state := store.Normal
|
||||||
|
memoFind.RowStatus = &state
|
||||||
|
}
|
||||||
if request.Direction == v1pb.Direction_ASC {
|
if request.Direction == v1pb.Direction_ASC {
|
||||||
memoFind.OrderByTimeAsc = true
|
memoFind.OrderByTimeAsc = true
|
||||||
}
|
}
|
||||||
@@ -123,18 +130,9 @@ func (s *APIV1Service) ListMemos(ctx context.Context, request *v1pb.ListMemosReq
|
|||||||
}
|
}
|
||||||
if currentUser == nil {
|
if currentUser == nil {
|
||||||
memoFind.VisibilityList = []store.Visibility{store.Public}
|
memoFind.VisibilityList = []store.Visibility{store.Public}
|
||||||
} else {
|
} else if memoFind.CreatorID == nil || *memoFind.CreatorID != currentUser.ID {
|
||||||
if memoFind.CreatorID == nil || *memoFind.CreatorID != currentUser.ID {
|
|
||||||
memoFind.VisibilityList = []store.Visibility{store.Public, store.Protected}
|
memoFind.VisibilityList = []store.Visibility{store.Public, store.Protected}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if request.State == v1pb.State_ARCHIVED {
|
|
||||||
state := store.Archived
|
|
||||||
memoFind.RowStatus = &state
|
|
||||||
} else {
|
|
||||||
state := store.Normal
|
|
||||||
memoFind.RowStatus = &state
|
|
||||||
}
|
|
||||||
|
|
||||||
var limit, offset int
|
var limit, offset int
|
||||||
if request.PageToken != "" {
|
if request.PageToken != "" {
|
||||||
|
Reference in New Issue
Block a user