missed placed
This commit is contained in:
@@ -158,6 +158,9 @@ func GenericUpdateOne(change map[string]interface{}, id string, a Accessor) (DBO
|
||||
}
|
||||
|
||||
func GenericLoadOne[T DBObject](id string, data T, f func(DBObject) (DBObject, int, error), a Accessor) (DBObject, int, error) {
|
||||
if a.ShouldVerifyAuth() && !data.VerifyAuth("get", a.GetRequest()) {
|
||||
return nil, 403, errors.New("you are not allowed to access :" + a.GetType().String())
|
||||
}
|
||||
res_mongo, code, err := mongo.MONGOService.LoadOne(id, a.GetType().String())
|
||||
if err != nil {
|
||||
return nil, code, err
|
||||
@@ -166,9 +169,6 @@ func GenericLoadOne[T DBObject](id string, data T, f func(DBObject) (DBObject, i
|
||||
return nil, 400, err
|
||||
}
|
||||
|
||||
if a.ShouldVerifyAuth() && !data.VerifyAuth("get", a.GetRequest()) {
|
||||
return nil, 403, errors.New("you are not allowed to access :" + a.GetType().String())
|
||||
}
|
||||
return f(data)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user