diff --git a/models/utils/common.go b/models/utils/common.go index fe68aae..bb4af5d 100755 --- a/models/utils/common.go +++ b/models/utils/common.go @@ -133,7 +133,7 @@ func GenericLoadOne[T DBObject](id string, data T, f func(DBObject) (DBObject, i 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 }