store
This commit is contained in:
@@ -27,7 +27,7 @@ const (
|
||||
* every data in base root model should inherit from this struct (only exception is the ResourceModel)
|
||||
*/
|
||||
type AbstractObject struct {
|
||||
UUID string `json:"id,omitempty" bson:"_id,omitempty" validate:"required"`
|
||||
UUID string `json:"id,omitempty" bson:"id,omitempty" validate:"required"`
|
||||
Name string `json:"name,omitempty" bson:"name,omitempty" validate:"required"`
|
||||
IsDraft bool `json:"is_draft" bson:"is_draft" default:"false"`
|
||||
CreatorID string `json:"creator_id,omitempty" bson:"creator_id,omitempty"`
|
||||
|
||||
@@ -2,7 +2,6 @@ package utils
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"cloud.o-forge.io/core/oc-lib/dbs"
|
||||
@@ -57,7 +56,6 @@ func GenericStoreOne(data DBObject, a Accessor) (DBObject, int, error) {
|
||||
if err != nil {
|
||||
return nil, 422, errors.New("error when validating the received struct: " + err.Error())
|
||||
}
|
||||
fmt.Println(data.GetName(), data.GetCreatorID())
|
||||
id, code, err := mongo.MONGOService.StoreOne(data, data.GetID(), a.GetType().String())
|
||||
if err != nil {
|
||||
a.GetLogger().Error().Msg("Could not store " + data.GetName() + " to db. Error: " + err.Error())
|
||||
|
||||
Reference in New Issue
Block a user