Skip to content

Commit

Permalink
Fix to edit call queue policy (#80)
Browse files Browse the repository at this point in the history
Signed-off-by: Tadayuki Onishi <[email protected]>
Co-authored-by: Tadayuki Onishi <[email protected]>
  • Loading branch information
kenchan0130 and Tadayuki Onishi authored Dec 24, 2024
1 parent 0f9a9ab commit 8e8c14a
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"
"errors"
"fmt"

"github.com/folio-sec/terraform-provider-zoom/generated/api/zoomphone"
"github.com/folio-sec/terraform-provider-zoom/internal/util"
"github.com/hashicorp/terraform-plugin-framework/types"
Expand Down Expand Up @@ -92,6 +93,12 @@ func (c *crud) update(ctx context.Context, dto *updateDto) error {
}
})
}
// Due to the patch API specifications, an error occurs as 'voicemail_access_members cannot be empty' with using emtpy list.
// Therefore, if the slice is empty, the function returns nil without performing any actions.
if len(voicemailAccessMembers) == 0 {
return nil
}

err := c.client.UpdateCQPolicySubSetting(ctx, zoomphone.OptUpdateCQPolicySubSettingReq{
Value: zoomphone.UpdateCQPolicySubSettingReq{
VoicemailAccessMembers: voicemailAccessMembers,
Expand Down

0 comments on commit 8e8c14a

Please sign in to comment.