Browse Source

adds notifications to running queries

master
Keviin Åberg Kultalahti 6 years ago
parent
commit
d2790ddd19
  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 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
} }

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

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

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

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

Loading…
Cancel
Save