Skip to content

Commit 42bb3af

Browse files
misscodedseratch
authored andcommitted
docs > updating modals - fix error in sample code
1 parent 37b0b0c commit 42bb3af

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

docs/_basic/opening_modals.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ Read more about modal composition in the <a href="https://api.slack.com/surfaces
2121
def open_modal(ack, body, client):
2222
# Acknowledge the command request
2323
ack();
24-
2524
# Call views_open with the built-in client
2625
client.views_open(
2726
# Pass a valid trigger_id within 3 seconds of receiving it

docs/_basic/updating_pushing_modals.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,15 @@ Learn more about updating and pushing views in our <a href="https://api.slack.co
2222
```python
2323
# Listen for a button invocation with action_id `button_abc` (assume it's inside of a modal)
2424
@app.action("button_abc")
25-
def update_modal(ack, view, client):
25+
def update_modal(ack, body, client):
2626
# Acknowledge the button request
2727
ack()
28+
# Call views_update with the built-in client
2829
client.views_update(
2930
# Pass the view_id
30-
view_id=view["id"],
31+
view_id=body["view"]["id"],
3132
# String that represents view state to protect against race conditions
32-
hash=view["hash"],
33+
hash=body["view"]["hash"],
3334
# View payload with updated blocks
3435
view={
3536
"type": "modal",

0 commit comments

Comments
 (0)