optionnal vars failed

This commit is contained in:
mr
2024-07-31 11:47:47 +02:00
parent 1ff4cb08d1
commit 2795c924f7
3 changed files with 10 additions and 1 deletions

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(), []string{"abstractresource.abstractobject.name", "abstractobject.name"}...); len(cursor) > 0 {
if cursor, _, _ := accessor.Search(data.GetName(), "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)

8
models/utils/common.go Normal file
View File

@@ -0,0 +1,8 @@
package utils
/*
type Price struct {
Price float64 `json:"price,omitempty" bson:"price,omitempty"`
Currency string `json:"currency,omitempty" bson:"currency,omitempty"`
}
*/