mirror of
https://github.com/cpvalente/ontime.git
synced 2026-09-12 17:49:37 +00:00
feat(automation): create global triggers with automations
This commit is contained in:
@@ -4,6 +4,7 @@ import type {
|
||||
AutomationDTO,
|
||||
AutomationOutput,
|
||||
AutomationSettings,
|
||||
AutomationTriggerDTO,
|
||||
Trigger,
|
||||
TriggerDTO,
|
||||
} from 'ontime-types';
|
||||
@@ -57,8 +58,11 @@ export function deleteTrigger(id: string): Promise<void> {
|
||||
/**
|
||||
* HTTP request to create a new automation
|
||||
*/
|
||||
export async function addAutomation(automation: AutomationDTO): Promise<Automation> {
|
||||
const res = await axios.post(`${automationsPath}/automation`, automation);
|
||||
export async function addAutomation(
|
||||
automation: AutomationDTO,
|
||||
triggers: AutomationTriggerDTO[] = [],
|
||||
): Promise<Automation> {
|
||||
const res = await axios.post(`${automationsPath}/automation`, { ...automation, triggers });
|
||||
return res.data;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user