From 97df436454dbdc75e0e578e767ba6ceb76601443 Mon Sep 17 00:00:00 2001 From: Alvin See Date: Sat, 4 Jun 2022 16:21:00 +1000 Subject: [PATCH] parse app_installed_team_id during view_submision and view_closed events --- interactions_test.go | 8 ++++++-- views.go | 37 +++++++++++++++++++------------------ 2 files changed, 25 insertions(+), 20 deletions(-) diff --git a/interactions_test.go b/interactions_test.go index 1e91f4b83..f492b1fd0 100644 --- a/interactions_test.go +++ b/interactions_test.go @@ -68,7 +68,8 @@ const ( "text": "Select a date" } } - }] + }], + "app_installed_team_id": "T1ABCD2E12" }, "api_app_id": "A123ABC", "is_cleared": false @@ -137,7 +138,8 @@ const ( } } } - } + }, + "app_installed_team_id": "T1ABCD2E12" }, "hash": "156663117.cd33ad1f", "response_urls": [ @@ -221,6 +223,7 @@ func TestViewClosedck(t *testing.T) { ), }, }, + AppInstalledTeamID: "T1ABCD2E12", }, APIAppID: "A123ABC", } @@ -297,6 +300,7 @@ func TestViewSubmissionCallback(t *testing.T) { }, }, }, + AppInstalledTeamID: "T1ABCD2E12", }, ViewSubmissionCallback: ViewSubmissionCallback{ Hash: "156663117.cd33ad1f", diff --git a/views.go b/views.go index a3a1bd056..e6a961788 100644 --- a/views.go +++ b/views.go @@ -18,24 +18,25 @@ type ViewState struct { type View struct { SlackResponse - ID string `json:"id"` - TeamID string `json:"team_id"` - Type ViewType `json:"type"` - Title *TextBlockObject `json:"title"` - Close *TextBlockObject `json:"close"` - Submit *TextBlockObject `json:"submit"` - Blocks Blocks `json:"blocks"` - PrivateMetadata string `json:"private_metadata"` - CallbackID string `json:"callback_id"` - State *ViewState `json:"state"` - Hash string `json:"hash"` - ClearOnClose bool `json:"clear_on_close"` - NotifyOnClose bool `json:"notify_on_close"` - RootViewID string `json:"root_view_id"` - PreviousViewID string `json:"previous_view_id"` - AppID string `json:"app_id"` - ExternalID string `json:"external_id"` - BotID string `json:"bot_id"` + ID string `json:"id"` + TeamID string `json:"team_id"` + Type ViewType `json:"type"` + Title *TextBlockObject `json:"title"` + Close *TextBlockObject `json:"close"` + Submit *TextBlockObject `json:"submit"` + Blocks Blocks `json:"blocks"` + PrivateMetadata string `json:"private_metadata"` + CallbackID string `json:"callback_id"` + State *ViewState `json:"state"` + Hash string `json:"hash"` + ClearOnClose bool `json:"clear_on_close"` + NotifyOnClose bool `json:"notify_on_close"` + RootViewID string `json:"root_view_id"` + PreviousViewID string `json:"previous_view_id"` + AppID string `json:"app_id"` + ExternalID string `json:"external_id"` + BotID string `json:"bot_id"` + AppInstalledTeamID string `json:"app_installed_team_id"` } type ViewSubmissionCallbackResponseURL struct {