0x4a52466c696e74 1 týždeň pred
rodič
commit
12998275d2
1 zmenil súbory, kde vykonal 4 pridanie a 2 odobranie
  1. 4 2
      rest_gorm/request_list.go

+ 4 - 2
rest_gorm/request_list.go

@@ -121,8 +121,10 @@ func (s *List) ResultOut(pg *gorm.DB, model any, req rest.IRequestIn) rest.IRequ
 		return req.OutError(rest.ErrorMessage("ErrFileds", err.Error()))
 	}
 	elemType := reflect.TypeOf(reflect.ValueOf(model))
-	sl := reflect.MakeSlice(reflect.SliceOf(elemType), 0, 0).Interface()
-	return s.ResultOutNames(pg, fieldNames, sl, req)
+	sl := reflect.MakeSlice(reflect.SliceOf(elemType), 0, 0)
+	slPtr := reflect.New(sl.Type())
+	slPtr.Set(sl)
+	return s.ResultOutNames(pg, fieldNames, sl.Interface(), req)
 }
 
 func (s *List) ResultOutNames(pg *gorm.DB, fields rest.FieldNamesList, res any, req rest.IRequestIn) rest.IRequestOut {