Debugging Put / GET ALL

This commit is contained in:
mr
2024-07-24 08:35:41 +02:00
parent b775298bb0
commit bde70dec9b
8 changed files with 46 additions and 29 deletions

View File

@@ -47,10 +47,12 @@ func (wfa ProcessingMongoAccessor) LoadAll() ([]utils.ShallowDBObject, int, erro
wfa.Logger.Error().Msg("Could not retrieve any from db. Error: " + err.Error())
return nil, code, err
}
for res_mongo.Next(mongo.MngoCtx) {
var obj ProcessingResource
res_mongo.Decode(&obj)
objs = append(objs, &obj.AbstractResource)
var results []ProcessingResource
if err = res_mongo.All(mongo.MngoCtx, &results); err != nil {
return nil, 404, err
}
for _, r := range results {
objs = append(objs, &r.AbstractResource)
}
return objs, 200, nil
}