From aaec46a39cb338eecad0cdb19ff1d9a1c417c698 Mon Sep 17 00:00:00 2001 From: Steven Date: Wed, 10 Jan 2024 00:10:59 +0800 Subject: [PATCH] chore: update find memo with updated time --- api/v2/memo_service.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/api/v2/memo_service.go b/api/v2/memo_service.go index 0e00e72ab..555e38add 100644 --- a/api/v2/memo_service.go +++ b/api/v2/memo_service.go @@ -141,6 +141,14 @@ func (s *APIV2Service) ListMemos(ctx context.Context, request *apiv2pb.ListMemos memoFind.VisibilityList = []store.Visibility{store.Public, store.Protected} } + memoDisplayWithUpdatedTs, err := s.getMemoDisplayWithUpdatedTsSettingValue(ctx) + if err != nil { + return nil, status.Errorf(codes.Internal, "failed to get memo display with updated ts setting value") + } + if memoDisplayWithUpdatedTs { + memoFind.OrderByUpdatedTs = true + } + if request.Limit != 0 { offset, limit := int(request.Offset), int(request.Limit) memoFind.Offset = &offset