From 61506f44f1269c923277f681964c78d995996948 Mon Sep 17 00:00:00 2001 From: Varakh Date: Fri, 14 Jun 2024 09:16:30 +0200 Subject: [PATCH] fix(filter): fixed filter for Updates ignoring desired state --- CHANGELOG.md | 1 + server/repository_update.go | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fb2ecd8..6ed7438 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ Changes adhere to [semantic versioning](https://semver.org). * github.com/go-playground/validator/v10 v10.22.0 * gorm.io/driver/postgres v1.5.9 * gorm.io/driver/sqlite v1.5.6 +* Fixed filter for Updates ignoring desired state ## [3.0.1] - 2024/06/10 diff --git a/server/repository_update.go b/server/repository_update.go index 8c7fcfe..cf6289d 100644 --- a/server/repository_update.go +++ b/server/repository_update.go @@ -232,7 +232,7 @@ func (r *updateDbRepo) paginate(page int, pageSize int, orderBy string, order st } states := make([]string, 0, len(state)) - if len(states) > 0 { + if len(state) > 0 { for _, s := range state { states = append(states, s.Value()) } @@ -249,7 +249,7 @@ func (r *updateDbRepo) count(searchTerm string, searchIn string, state ...api.Up var c int64 states := make([]string, 0, len(state)) - if len(states) > 0 { + if len(state) > 0 { for _, s := range state { states = append(states, s.Value()) }