Skip to content

Commit

Permalink
fix(cli): commands for worker hooks
Browse files Browse the repository at this point in the history
Signed-off-by: francois  samin <[email protected]>
  • Loading branch information
fsamin committed Oct 20, 2021
1 parent 99bb72e commit e570210
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions cli/cdsctl/project_integration.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ func projectIntegrationExportFunc(v cli.Values) error {
}

var projectIntegrationWorkerHooksExportCmd = cli.Command{
Name: "export",
Name: "worker-hooks-export",
Short: "Export integration worker hooks available on a project",
Ctx: []cli.Arg{
{Name: _ProjectKey},
Expand All @@ -144,7 +144,7 @@ func projectIntegrationWorkerHooksExportFunc(v cli.Values) error {
}

var projectIntegrationWorkerHooksImportCmd = cli.Command{
Name: "import",
Name: "worker-hooks-import",
Short: "Import integration worker hooks on a project",
Ctx: []cli.Arg{
{Name: _ProjectKey},
Expand Down Expand Up @@ -172,7 +172,7 @@ func projectIntegrationWorkerHooksImportFunc(v cli.Values) error {
return cli.WrapError(err, "unable to parse file %s", v.GetString("filename"))
}

_, err = client.ProjectIntegrationWorkerHooksList(v.GetString(_ProjectKey), v.GetString("integration"))
err = client.ProjectIntegrationWorkerHooksImport(v.GetString(_ProjectKey), v.GetString("integration"), whs)
if err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion sdk/cdsclient/client_project_integration.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ func (c *client) ProjectIntegrationWorkerHooksList(projectKey string, integratio

func (c *client) ProjectIntegrationWorkerHooksImport(projectKey string, integrationName string, hooks []sdk.WorkerHookProjectIntegrationModel) error {
path := fmt.Sprintf("/project/%s/integrations/%s/workerhooks", projectKey, integrationName)
if _, err := c.GetJSON(context.Background(), path, &hooks); err != nil {
if _, err := c.PostJSON(context.Background(), path, &hooks, nil); err != nil {
return err
}
return nil
Expand Down

0 comments on commit e570210

Please sign in to comment.