Skip to content

Commit

Permalink
Merge pull request #67 from mgeorgebrown89/plainttextinput-fix
Browse files Browse the repository at this point in the history
views.publish fix
  • Loading branch information
mgeorgebrown89 authored Nov 1, 2019
2 parents 279de6d + bc03fdf commit 1b656f5
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions Slack/Slack.WebAPI/Public/views/Update-SlackView.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,22 @@ function Update-SlackView {
[string]
$view_id
)

$Body = [PSCustomObject]@{
view = $view
external_id = $external_id
hash = $hash
view_id = $view_id
if ($view_id -and !$external_id) {
$Body = [PSCustomObject]@{
view = $view
hash = $hash
view_id = $view_id
}
}
elseif ($external_id -and !$view_id) {
$Body = [PSCustomObject]@{
view = $view
external_id = $external_id
hash = $hash
}
}
else {
Write-Error "You can't use both view_id and external_id."
}

Invoke-SlackWebAPI -Token $Token -Method_Family "views.update" -Body $Body
Expand Down

0 comments on commit 1b656f5

Please sign in to comment.