From 6cb6de2c5a49a7c613bb9df907061c18ed30cfc2 Mon Sep 17 00:00:00 2001 From: Lennart Fleischmann Date: Thu, 22 Feb 2024 17:38:51 +0100 Subject: [PATCH] fix: add missing test persister implementation --- backend/test/password_credential_persister.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/backend/test/password_credential_persister.go b/backend/test/password_credential_persister.go index 388df60fe..36fb18b7a 100644 --- a/backend/test/password_credential_persister.go +++ b/backend/test/password_credential_persister.go @@ -38,3 +38,17 @@ func (p passwordCredentialPersister) Update(password models.PasswordCredential) } return nil } + +func (p *passwordCredentialPersister) Delete(password models.PasswordCredential) error { + index := -1 + for i, data := range p.passwords { + if data.ID == password.ID { + index = i + } + } + if index > -1 { + p.passwords = append(p.passwords[:index], p.passwords[index+1:]...) + } + + return nil +}