Skip to content

Commit

Permalink
fix(webhooks): correct webhook endpoint (#334)
Browse files Browse the repository at this point in the history
  • Loading branch information
parkedwards authored Dec 17, 2024
1 parent da29a47 commit 3bae9ac
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions internal/provider/resources/webhooks.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ func (r *WebhookResource) Create(ctx context.Context, req resource.CreateRequest
// Extract the endpoint from the provider configuration.
// https://github.com/PrefectHQ/terraform-provider-prefect/issues/333
copyWebhookResponseToModel(webhook, &plan)
plan.Endpoint = types.StringValue(fmt.Sprintf("https://api.prefect.cloud/%s", webhook.Slug))
plan.Endpoint = types.StringValue(fmt.Sprintf("https://api.prefect.cloud/hooks/%s", webhook.Slug))

resp.Diagnostics.Append(resp.State.Set(ctx, &plan)...)
if resp.Diagnostics.HasError() {
Expand Down Expand Up @@ -233,7 +233,7 @@ func (r *WebhookResource) Read(ctx context.Context, req resource.ReadRequest, re
// Extract the endpoint from the provider configuration.
// https://github.com/PrefectHQ/terraform-provider-prefect/issues/333
copyWebhookResponseToModel(webhook, &state)
state.Endpoint = types.StringValue(fmt.Sprintf("https://api.prefect.cloud/%s", webhook.Slug))
state.Endpoint = types.StringValue(fmt.Sprintf("https://api.prefect.cloud/hooks/%s", webhook.Slug))

resp.Diagnostics.Append(resp.State.Set(ctx, &state)...)
if resp.Diagnostics.HasError() {
Expand Down Expand Up @@ -283,7 +283,7 @@ func (r *WebhookResource) Update(ctx context.Context, req resource.UpdateRequest
// Extract the endpoint from the provider configuration.
// https://github.com/PrefectHQ/terraform-provider-prefect/issues/333
copyWebhookResponseToModel(webhook, &plan)
plan.Endpoint = types.StringValue(fmt.Sprintf("https://api.prefect.cloud/%s", webhook.Slug))
plan.Endpoint = types.StringValue(fmt.Sprintf("https://api.prefect.cloud/hooks/%s", webhook.Slug))

resp.Diagnostics.Append(resp.State.Set(ctx, &plan)...)
if resp.Diagnostics.HasError() {
Expand Down

0 comments on commit 3bae9ac

Please sign in to comment.