From b338c17d38f8a1f9104d7c7aa245584edac8e66c Mon Sep 17 00:00:00 2001 From: Lars Lehmann Date: Fri, 13 Sep 2024 23:19:43 +0200 Subject: [PATCH] Fix flow background update (#482) --- internal/provider/resource_flow.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/internal/provider/resource_flow.go b/internal/provider/resource_flow.go index ac98d09..f0f5454 100644 --- a/internal/provider/resource_flow.go +++ b/internal/provider/resource_flow.go @@ -91,7 +91,6 @@ func resourceFlowSchemaToModel(d *schema.ResourceData) *api.FlowRequest { Authentication: api.AuthenticationEnum(d.Get("authentication").(string)).Ptr(), PolicyEngineMode: api.PolicyEngineMode(d.Get("policy_engine_mode").(string)).Ptr(), Layout: api.FlowLayoutEnum(d.Get("layout").(string)).Ptr(), - Background: d.Get("background").(string), DeniedAction: api.DeniedActionEnum(d.Get("denied_action").(string)).Ptr(), } return &m @@ -156,6 +155,15 @@ func resourceFlowUpdate(ctx context.Context, d *schema.ResourceData, m interface } d.SetId(res.Slug) + + if bg, ok := d.GetOk("background"); ok { + hr, err := c.client.FlowsApi.FlowsInstancesSetBackgroundUrlCreate(ctx, res.Slug).FilePathRequest(api.FilePathRequest{ + Url: bg.(string), + }).Execute() + if err != nil { + return httpToDiag(d, hr, err) + } + } return resourceFlowRead(ctx, d, m) }