This commit is contained in:
mr 2024-12-03 09:25:27 +01:00
parent 6042d47700
commit 2924ccd23b

View File

@ -204,7 +204,7 @@ func GenericLoadOne[T DBObject](id string, f func(DBObject) (DBObject, int, erro
func genericLoadAll[T DBObject](res *mgb.Cursor, code int, err error, f func(DBObject) ShallowDBObject, a Accessor) ([]ShallowDBObject, int, error) { func genericLoadAll[T DBObject](res *mgb.Cursor, code int, err error, f func(DBObject) ShallowDBObject, a Accessor) ([]ShallowDBObject, int, error) {
objs := []ShallowDBObject{} objs := []ShallowDBObject{}
results := []T{} var results []T
if err != nil { if err != nil {
a.GetLogger().Error().Msg("Could not retrieve any from db. Error: " + err.Error()) a.GetLogger().Error().Msg("Could not retrieve any from db. Error: " + err.Error())
return nil, code, err return nil, code, err