mirror of
https://github.com/usememos/memos.git
synced 2025-06-05 22:09:59 +02:00
feat: support pinned factor
This commit is contained in:
@@ -108,7 +108,6 @@ func (s *APIV1Service) ListMemos(ctx context.Context, request *v1pb.ListMemosReq
|
||||
return nil, status.Errorf(codes.InvalidArgument, "invalid parent: %v", err)
|
||||
}
|
||||
memoFind.CreatorID = &userID
|
||||
memoFind.OrderByPinned = true
|
||||
}
|
||||
if request.State == v1pb.State_ARCHIVED {
|
||||
state := store.Archived
|
||||
|
@@ -62,6 +62,9 @@ func (s *APIV1Service) ListAllUserStats(ctx context.Context, _ *v1pb.ListAllUser
|
||||
for _, tag := range memo.Payload.Tags {
|
||||
userStats.TagCount[tag]++
|
||||
}
|
||||
if memo.Pinned {
|
||||
userStats.PinnedMemos = append(userStats.PinnedMemos, fmt.Sprintf("%s%s", MemoNamePrefix, memo.UID))
|
||||
}
|
||||
if memo.Payload.Property.GetHasLink() {
|
||||
userStats.MemoTypeStats.LinkCount++
|
||||
}
|
||||
@@ -140,6 +143,9 @@ func (s *APIV1Service) GetUserStats(ctx context.Context, request *v1pb.GetUserSt
|
||||
for _, tag := range memo.Payload.Tags {
|
||||
userStats.TagCount[tag]++
|
||||
}
|
||||
if memo.Pinned {
|
||||
userStats.PinnedMemos = append(userStats.PinnedMemos, fmt.Sprintf("%s%s", MemoNamePrefix, memo.UID))
|
||||
}
|
||||
if memo.Payload.Property.GetHasLink() {
|
||||
userStats.MemoTypeStats.LinkCount++
|
||||
}
|
||||
|
Reference in New Issue
Block a user