This commit is contained in:
mr
2026-02-05 15:30:23 +01:00
parent 543d28e5d2
commit b9e7ce20b6
3 changed files with 4 additions and 5 deletions

View File

@@ -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"`

View File

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