From 274ce57f5b504bd70c0b4aa11d590ff7051214fa Mon Sep 17 00:00:00 2001 From: mr Date: Wed, 31 Jul 2024 10:36:57 +0200 Subject: [PATCH] private accessor --- models/utils/abstracts.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/utils/abstracts.go b/models/utils/abstracts.go index 4d17af5..d25ca0a 100644 --- a/models/utils/abstracts.go +++ b/models/utils/abstracts.go @@ -45,7 +45,7 @@ func (dma *AbstractAccessor) SetLogger(t DataType) { func (wfa *AbstractAccessor) GenericStoreOne(data DBObject, accessor Accessor) (DBObject, int, error) { data.GenerateID() - if cursor, _, _ := accessor.Search(data.GetName(), "abstractresource.abstractobject.name", "abstractobject.name"); len(cursor) > 0 { + if cursor, _, _ := accessor.Search(data.GetName(), []string{"abstractresource.abstractobject.name", "abstractobject.name"}...); len(cursor) > 0 { return nil, 409, errors.New(accessor.GetType() + " with name " + data.GetName() + " already exists") } err := validate.Struct(data)