fix exist check

This commit is contained in:
Adrian Zürcher
2025-11-07 08:09:10 +01:00
parent 86a4ef798a
commit 21388b63fb
5 changed files with 6 additions and 8 deletions

View File

@@ -55,8 +55,7 @@ func (dh *DatabaseHandler) responsibleExists(CheckResponsible models.Person) (bo
}
var person models.Person
err := dh.database.Exists(&person, "lastName", CheckResponsible.LastName, false)
if err != nil {
if !dh.database.Exists(&person, "lastName", CheckResponsible.LastName, false) {
return false, nil
}
return person.FirstName == CheckResponsible.FirstName && person.LastName == CheckResponsible.LastName, nil