resource as resource named1
This commit is contained in:
parent
2a9a784ec1
commit
20913f056b
@ -34,12 +34,12 @@ func (dma *AbstractAccessor) SetLogger(t DataType) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (wfa *AbstractAccessor) GenericStoreOne(data DBObject, accessor Accessor) (DBObject, error) {
|
func (wfa *AbstractAccessor) GenericStoreOne(data DBObject, accessor Accessor) (DBObject, error) {
|
||||||
|
data.GenerateID()
|
||||||
err := validate.Struct(data)
|
err := validate.Struct(data)
|
||||||
wfa.Logger.Error().Msg("Could not store " + data.GetName() + " to db. Error: " + err.Error())
|
wfa.Logger.Error().Msg("Could not store " + data.GetName() + " to db. Error: " + err.Error())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
data.GenerateID()
|
|
||||||
id, err := mongo.MONGOService.StoreOne(data, wfa.GetType())
|
id, err := mongo.MONGOService.StoreOne(data, wfa.GetType())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
wfa.Logger.Error().Msg("Could not store " + data.GetName() + " to db. Error: " + err.Error())
|
wfa.Logger.Error().Msg("Could not store " + data.GetName() + " to db. Error: " + err.Error())
|
||||||
|
Loading…
Reference in New Issue
Block a user