likyh commented on code in PR #2374:
URL: https://github.com/apache/incubator-devlake/pull/2374#discussion_r909233528


##########
plugins/tapd/tasks/shared.go:
##########
@@ -115,19 +115,24 @@ type TapdApiParams struct {
        WorkspaceId  uint64
 }
 
-func CreateRawDataSubTaskArgs(taskCtx core.SubTaskContext, rawTable string) 
(*helper.RawDataSubTaskArgs, *TapdTaskData) {
+func CreateRawDataSubTaskArgs(taskCtx core.SubTaskContext, rawTable string, 
useCompanyId bool) (*helper.RawDataSubTaskArgs, *TapdTaskData) {
        data := taskCtx.GetData().(*TapdTaskData)
+       filteredData := *data
+       filteredData.Options = &TapdOptions{}
+       *filteredData.Options = *data.Options
        var params = TapdApiParams{
                ConnectionId: data.Options.ConnectionId,
                WorkspaceId:  data.Options.WorkspaceId,
        }
-       if data.Options.CompanyId != 0 {
+       if data.Options.CompanyId != 0 && useCompanyId {
                params.CompanyId = data.Options.CompanyId
+       } else {
+               filteredData.Options.CompanyId = 0
        }
        RawDataSubTaskArgs := &helper.RawDataSubTaskArgs{
                Ctx:    taskCtx,
                Params: params,
                Table:  rawTable,
        }
-       return RawDataSubTaskArgs, data
+       return RawDataSubTaskArgs, &filteredData

Review Comment:
   avoid using companyId but forget to set useCompanyId=true.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to