1
0
Fork 0
mirror of synced 2024-10-04 20:13:35 +13:00

adds notifications to running queries

This commit is contained in:
Keviin Åberg Kultalahti 2021-01-25 12:57:04 +01:00
parent 8713105b62
commit d2790ddd19
3 changed files with 6 additions and 3 deletions

View file

@ -10,6 +10,6 @@ export const triggerAutomation = async (automationId, fields) => {
}) })
res.error res.error
? notificationStore.danger("En error has occured") ? notificationStore.danger("En error has occured")
: notificationStore.success("Automation triggered.") : notificationStore.success("Automation triggered")
return res return res
} }

View file

@ -4,11 +4,14 @@ import API from "./api"
* Executes a query against an external data connector. * Executes a query against an external data connector.
*/ */
export const executeQuery = async ({ queryId, parameters }) => { export const executeQuery = async ({ queryId, parameters }) => {
const response = await API.post({ const res = await API.post({
url: `/api/queries/${queryId}`, url: `/api/queries/${queryId}`,
body: { body: {
parameters, parameters,
}, },
}) })
res.error
? notificationStore.danger("En error has occured")
: notificationStore.success("Query successful")
return response return response
} }

View file

@ -66,7 +66,7 @@ export const deleteRows = async ({ tableId, rows }) => {
}) })
res.error res.error
? notificationStore.danger("En error has occured") ? notificationStore.danger("En error has occured")
: notificationStore.success(`${rows.length} rows deleted.`) : notificationStore.success(`${rows.length} row(s) deleted`)
return res return res
} }