Files
Automata/packages/editor-ui/src/mixins/externalHooks.ts
Iván Ovejero d5c44987f4 refactor(editor): Add infix to Pinia stores (no-changelog) (#6149)
*  Add infix to Pinia stores

*  Fix paths in mocks

* 🐛 Fix import
2023-05-05 10:41:54 +02:00

18 lines
536 B
TypeScript

import type { IExternalHooks } from '@/Interface';
import type { IDataObject } from 'n8n-workflow';
import { useWebhooksStore } from '@/stores/webhooks.store';
import { defineComponent } from 'vue';
import { runExternalHook } from '@/utils';
export const externalHooks = defineComponent({
methods: {
$externalHooks(): IExternalHooks {
return {
run: async (eventName: string, metadata?: IDataObject): Promise<void> => {
await runExternalHook.call(this, eventName, useWebhooksStore(), metadata);
},
};
},
},
});