by pass temp
This commit is contained in:
@@ -2,7 +2,6 @@ package resources
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
|
||||||
"slices"
|
"slices"
|
||||||
|
|
||||||
"cloud.o-forge.io/core/oc-lib/dbs"
|
"cloud.o-forge.io/core/oc-lib/dbs"
|
||||||
@@ -37,7 +36,6 @@ func NewAccessor[T ResourceInterface](t tools.DataType, request *tools.APIReques
|
|||||||
case tools.STORAGE_RESOURCE:
|
case tools.STORAGE_RESOURCE:
|
||||||
return &StorageResource{}
|
return &StorageResource{}
|
||||||
case tools.PROCESSING_RESOURCE:
|
case tools.PROCESSING_RESOURCE:
|
||||||
fmt.Println("It's a processing resource")
|
|
||||||
return &ProcessingResource{}
|
return &ProcessingResource{}
|
||||||
case tools.WORKFLOW_RESOURCE:
|
case tools.WORKFLOW_RESOURCE:
|
||||||
return &WorkflowResource{}
|
return &WorkflowResource{}
|
||||||
@@ -68,6 +66,10 @@ func (dca *ResourceMongoAccessor[T]) UpdateOne(set map[string]interface{}, id st
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (dca *ResourceMongoAccessor[T]) ShouldVerifyAuth() bool {
|
||||||
|
return false // TEMP : by pass
|
||||||
|
}
|
||||||
|
|
||||||
func (dca *ResourceMongoAccessor[T]) StoreOne(data utils.DBObject) (utils.DBObject, int, error) {
|
func (dca *ResourceMongoAccessor[T]) StoreOne(data utils.DBObject) (utils.DBObject, int, error) {
|
||||||
if dca.GetType() == tools.COMPUTE_RESOURCE {
|
if dca.GetType() == tools.COMPUTE_RESOURCE {
|
||||||
return nil, 404, errors.New("can't create a non existing computing units resource not reported onto compute units catalog")
|
return nil, 404, errors.New("can't create a non existing computing units resource not reported onto compute units catalog")
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import (
|
|||||||
"crypto/sha256"
|
"crypto/sha256"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
|
||||||
"slices"
|
"slices"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@@ -251,7 +250,6 @@ func (a *AbstractAccessor[T]) CopyOne(data DBObject) (DBObject, int, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (a *AbstractAccessor[T]) LoadOne(id string) (DBObject, int, error) {
|
func (a *AbstractAccessor[T]) LoadOne(id string) (DBObject, int, error) {
|
||||||
fmt.Println(a.Type)
|
|
||||||
return GenericLoadOne(id, a.New(), func(d DBObject) (DBObject, int, error) {
|
return GenericLoadOne(id, a.New(), func(d DBObject) (DBObject, int, error) {
|
||||||
return d, 200, nil
|
return d, 200, nil
|
||||||
}, a)
|
}, a)
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ package utils
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"cloud.o-forge.io/core/oc-lib/dbs"
|
"cloud.o-forge.io/core/oc-lib/dbs"
|
||||||
@@ -132,7 +131,6 @@ func GenericLoadOne[T DBObject](id string, data T, f func(DBObject) (DBObject, i
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, code, err
|
return nil, code, err
|
||||||
}
|
}
|
||||||
fmt.Println("APPLY", data, res_mongo)
|
|
||||||
if err = res_mongo.Decode(data); err != nil {
|
if err = res_mongo.Decode(data); err != nil {
|
||||||
return nil, 400, err
|
return nil, 400, err
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user