private accessor

This commit is contained in:
mr 2024-07-31 10:36:57 +02:00
parent 00fe19083b
commit 274ce57f5b

View File

@ -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)