Modal fails to update or push the new view upon modal view submission. Slack's Bolt documentation only shows modal update or push through an interactive component. Correct functionality can be seen with the Giphy slack app.
Here's my code for the modal view I'm wanting to push:
app.action({'callback_id': 'gifsearchview_1'}, async ({ ack, body, context }) => {
await ack();
try {
const result = await app.client.views.push({
token: context.botToken,
view_id: body.view.id,
// View payload with updated blocks
view: {
// View identifier
"type": "modal",
"callback_id": 'gifsearchview_2',
"title": {
"type": "plain_text",
"text": "Search Results",
"emoji": true
},
"submit": {
"type": "plain_text",
"text": "Submit"
},
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "Updated."
},
}
]
}
});
console.log(result);
}
catch (error) {
console.error(error);
}
});