feat: Add run method to placetel hungup trigger
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
|
import Crypto from 'crypto';
|
||||||
import { IJSONObject } from '@automatisch/types';
|
import { IJSONObject } from '@automatisch/types';
|
||||||
import defineTrigger from '../../../../helpers/define-trigger';
|
import defineTrigger from '../../../../helpers/define-trigger';
|
||||||
|
|
||||||
@@ -37,6 +38,17 @@ export default defineTrigger({
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|
||||||
|
async run($) {
|
||||||
|
const dataItem = {
|
||||||
|
raw: $.request.body,
|
||||||
|
meta: {
|
||||||
|
internalId: Crypto.randomUUID(),
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
$.pushTriggerItem(dataItem);
|
||||||
|
},
|
||||||
|
|
||||||
async testRun($) {
|
async testRun($) {
|
||||||
const response = await $.http.get('/v2/calls?order=desc');
|
const response = await $.http.get('/v2/calls?order=desc');
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user