From 732514300b793a5c92b6f6752613b3bc48dd4540 Mon Sep 17 00:00:00 2001 From: mfnefd Date: Tue, 10 Dec 2024 23:59:28 +0400 Subject: [PATCH] =?UTF-8?q?fix:=20=D1=82=D0=B5=D0=BF=D0=B5=D1=80=D1=8C=20?= =?UTF-8?q?=D1=80=D0=B5=D0=BF=D0=BE=D0=B7=D0=B8=D1=82=D0=BE=D1=80=D0=B8?= =?UTF-8?q?=D0=B9=20=D0=BD=D0=B0=D1=85=D0=BE=D0=B4=D0=B8=D1=82=20=D0=B3?= =?UTF-8?q?=D1=80=D1=83=D0=BF=D0=BF=D1=8B=20=D0=B7=D0=B0=D1=82=D1=80=D0=B0?= =?UTF-8?q?=D1=82=20=D0=BF=D0=BE=20id=20=D0=BF=D0=BE=D0=BB=D1=8C=D0=B7?= =?UTF-8?q?=D0=BE=D0=B2=D0=B0=D1=82=D0=B5=D0=BB=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- back/Infrastructure/Repositories/SpendingGroupRepo.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/back/Infrastructure/Repositories/SpendingGroupRepo.cs b/back/Infrastructure/Repositories/SpendingGroupRepo.cs index dece4fa..b7a36a3 100644 --- a/back/Infrastructure/Repositories/SpendingGroupRepo.cs +++ b/back/Infrastructure/Repositories/SpendingGroupRepo.cs @@ -102,10 +102,13 @@ public class SpendingGroupRepo : ISpendingGroupRepo query = query.Where(x => x.Id == search.Id); } - if (!string.IsNullOrWhiteSpace(search.Name) && search.UserId.HasValue) + if (search.UserId.HasValue) { - query = query.Where(x => x.Name.Contains(search.Name, StringComparison.OrdinalIgnoreCase) - && x.UserId == search.UserId); + query = query.Where(x => x.UserId == search.UserId); + if (!string.IsNullOrWhiteSpace(search.Name)) + { + query = query.Where(x => x.Name.Contains(search.Name, StringComparison.OrdinalIgnoreCase)); + } } }