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
? notificationStore.danger("En error has occured")
: notificationStore.success("Automation triggered.")
: notificationStore.success("Automation triggered")
return res
}

View File

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

View File

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