From c92507728a190d98356d1f867b366666bad740ed Mon Sep 17 00:00:00 2001 From: Steven Date: Sun, 4 Feb 2024 21:07:14 +0800 Subject: [PATCH] chore: tweak filter checks --- api/v2/memo_service.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/api/v2/memo_service.go b/api/v2/memo_service.go index e45adc93..10665f58 100644 --- a/api/v2/memo_service.go +++ b/api/v2/memo_service.go @@ -793,11 +793,9 @@ func (s *APIV2Service) buildMemoFindWithFilter(ctx context.Context, find *store. if filter.RowStatus != nil { find.RowStatus = filter.RowStatus } - } else { + } else if user == nil { // If no filter is provided, check if the user is authenticated. - if user == nil { - return status.Errorf(codes.InvalidArgument, "filter is required") - } + return status.Errorf(codes.InvalidArgument, "filter is required") } // If the user is not authenticated, only public memos are visible.