From 5c3b2e19cf0280ce03d2d7ce118221c9c5e410c0 Mon Sep 17 00:00:00 2001 From: Nathan Coad Date: Tue, 16 Jan 2024 16:49:37 +1100 Subject: [PATCH] another fix --- models/secret.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/models/secret.go b/models/secret.go index 866a9cb..ef4d9a0 100644 --- a/models/secret.go +++ b/models/secret.go @@ -128,6 +128,10 @@ func SecretsGetAllowed(s *Secret, userId int) ([]UserSecret, error) { queryArgs = append(queryArgs, userId) // Add any other arguments to the query if they were specified + if s.SecretId > 0 { + query += " AND SecretId = ? " + queryArgs = append(queryArgs, s.SecretId) + } if s.DeviceName != "" { query += " AND DeviceName LIKE ? " queryArgs = append(queryArgs, s.DeviceName)