Skip to content

Commit b38fde5

Browse files
AchoArnoldCopilot
andcommitted
feat: add error notification for bulk messages history fetch
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent f5ebc2b commit b38fde5

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

web/store/index.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -395,14 +395,18 @@ export const actions = {
395395
}
396396
},
397397

398-
fetchBulkMessageOrders() {
398+
fetchBulkMessageOrders(context: ActionContext<State, State>) {
399399
return new Promise<any[]>((resolve, reject) => {
400400
axios
401401
.get<{ data: any[] }>(`/v1/bulk-messages`)
402402
.then((response) => {
403403
resolve(response.data.data ?? [])
404404
})
405-
.catch((error: AxiosError) => {
405+
.catch(async (error: AxiosError) => {
406+
await context.dispatch('addNotification', {
407+
message: 'Error while fetching bulk messages history',
408+
type: 'error',
409+
})
406410
reject(error)
407411
})
408412
})

0 commit comments

Comments
 (0)