Copy
This commit is contained in:
@@ -9,13 +9,13 @@ import (
|
||||
"cloud.o-forge.io/core/oc-lib/tools"
|
||||
)
|
||||
|
||||
type computeUnitsMongoAccessor[T LiveInterface] struct {
|
||||
type liveMongoAccessor[T LiveInterface] struct {
|
||||
utils.AbstractAccessor[LiveInterface] // AbstractAccessor contains the basic fields of an accessor (model, caller)
|
||||
}
|
||||
|
||||
// New creates a new instance of the computeUnitsMongoAccessor
|
||||
func NewAccessor[T LiveInterface](t tools.DataType, request *tools.APIRequest) *computeUnitsMongoAccessor[T] {
|
||||
return &computeUnitsMongoAccessor[T]{
|
||||
func NewAccessor[T LiveInterface](t tools.DataType, request *tools.APIRequest) *liveMongoAccessor[T] {
|
||||
return &liveMongoAccessor[T]{
|
||||
AbstractAccessor: utils.AbstractAccessor[LiveInterface]{
|
||||
Logger: logs.CreateLogger(t.String()), // Create a logger with the data type
|
||||
Request: request,
|
||||
@@ -36,7 +36,7 @@ func NewAccessor[T LiveInterface](t tools.DataType, request *tools.APIRequest) *
|
||||
/*
|
||||
* Nothing special here, just the basic CRUD operations
|
||||
*/
|
||||
func (a *computeUnitsMongoAccessor[T]) CopyOne(data utils.DBObject) (utils.DBObject, int, error) {
|
||||
func (a *liveMongoAccessor[T]) CopyOne(data utils.DBObject) (utils.DBObject, int, error) {
|
||||
// is a publisher... that become a resources.
|
||||
if data.IsDrafted() {
|
||||
return nil, 422, errors.New("can't publish a drafted compute units")
|
||||
|
||||
Reference in New Issue
Block a user