mirror of https://github.com/Budibase/budibase.git
committed by
GitHub
6 changed files with 36 additions and 45 deletions
@ -1,10 +1,15 @@ |
|||
import { notificationStore } from "../store/notification" |
|||
import API from "./api" |
|||
/** |
|||
* Executes an automation. Must have "App Action" trigger. |
|||
*/ |
|||
export const triggerAutomation = async (automationId, fields) => { |
|||
return await API.post({ |
|||
const res = await API.post({ |
|||
url: `/api/automations/${automationId}/trigger`, |
|||
body: { fields }, |
|||
}) |
|||
res.error |
|||
? notificationStore.danger("An error has occurred") |
|||
: notificationStore.success("Automation triggered") |
|||
return res |
|||
} |
|||
|
|||
@ -1,14 +1,18 @@ |
|||
import { notificationStore } from "../store/notification" |
|||
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, |
|||
}, |
|||
}) |
|||
return response |
|||
res.error |
|||
? notificationStore.danger("An error has occurred") |
|||
: notificationStore.success("Query successful") |
|||
return res |
|||
} |
|||
|
|||
Loading…
Reference in new issue