Browse Source

adds notifications to running queries

pull/1013/head
Keviin Åberg Kultalahti 6 years ago
parent
commit
737c9fe52f
  1. 2
      packages/client/src/api/automations.js
  2. 5
      packages/client/src/api/queries.js
  3. 2
      packages/client/src/api/rows.js

2
packages/client/src/api/automations.js

@ -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
}

5
packages/client/src/api/queries.js

@ -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
}

2
packages/client/src/api/rows.js

@ -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
}

Loading…
Cancel
Save