From d58b74ad0b354e4a4cef53349ebcaeeba381be70 Mon Sep 17 00:00:00 2001 From: Ognjen Cirkovic Date: Tue, 13 Dec 2022 15:31:59 +0100 Subject: Popravljen filter... --- Backend/Api/Api/Services/PostService.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'Backend/Api') diff --git a/Backend/Api/Api/Services/PostService.cs b/Backend/Api/Api/Services/PostService.cs index 1c8f647..5a285e5 100644 --- a/Backend/Api/Api/Services/PostService.cs +++ b/Backend/Api/Api/Services/PostService.cs @@ -394,19 +394,19 @@ namespace Api.Services { if (ratingFrom >= 0) { - ls = ls.FindAll(post => post.ratings > ratingFrom).ToList(); + ls = ls.FindAll(post => Math.Floor(post.ratings) >= ratingFrom).ToList(); } if (ratingTo >= 0) { - ls= ls.FindAll(post => post.ratings < ratingTo).ToList(); + ls= ls.FindAll(post => Math.Ceiling(post.ratings) <= ratingTo).ToList(); } if (viewsFrom >= 0) { - ls = ls.FindAll(post => post.views >viewsFrom).ToList(); + ls = ls.FindAll(post => post.views >=viewsFrom).ToList(); } if (viewsTo >= 0) { - ls = ls.FindAll(post => post.views < viewsTo).ToList(); + ls = ls.FindAll(post => post.views <= viewsTo).ToList(); } } -- cgit v1.2.3