作者 庄敏学

删除时删数据源

@@ -59,6 +59,11 @@ func (l *DeleteChartLogic) DeleteChart(req *types.ChartDeleteRequest) (resp *typ @@ -59,6 +59,11 @@ func (l *DeleteChartLogic) DeleteChart(req *types.ChartDeleteRequest) (resp *typ
59 chartSetting, err := l.svcCtx.ChartSettingRepository.FindOne(l.ctx, conn, chart.Id) 59 chartSetting, err := l.svcCtx.ChartSettingRepository.FindOne(l.ctx, conn, chart.Id)
60 if err == nil && len(chartSetting.DataSourceIds) > 0 { 60 if err == nil && len(chartSetting.DataSourceIds) > 0 {
61 for _, sourceId := range chartSetting.DataSourceIds { 61 for _, sourceId := range chartSetting.DataSourceIds {
  62 + //删除数据源
  63 + err = DeleteObjectTable(l.ctx, l.svcCtx, conn, int(sourceId))
  64 + if err != nil {
  65 + return xerr.NewErrMsg("删除失败")
  66 + }
62 //删除分组 67 //删除分组
63 err = l.svcCtx.ObjectTableRepository.DeleteGroup(ctx, conn, tenantId, int(sourceId)) 68 err = l.svcCtx.ObjectTableRepository.DeleteGroup(ctx, conn, tenantId, int(sourceId))
64 if err != nil { 69 if err != nil {