feat(virtualq): add actions to manage waiters

This commit is contained in:
Ali BARIN
2024-12-20 13:18:25 +00:00
parent 28da91b19a
commit b0e186cfbd
17 changed files with 571 additions and 0 deletions

View File

@@ -0,0 +1,34 @@
import defineAction from '../../../../helpers/define-action.js';
export default defineAction({
name: 'Delete waiter',
key: 'deleteWaiter',
description:
'Cancels waiting. The provided waiter will be removed from the queue.',
arguments: [
{
label: 'Waiter',
key: 'waiterId',
type: 'dropdown',
required: true,
variables: true,
source: {
type: 'query',
name: 'getDynamicData',
arguments: [
{
name: 'key',
value: 'listWaiters',
},
],
},
},
],
async run($) {
const waiterId = $.step.parameters.waiterId;
const { data } = await $.http.delete(`/v2/waiters/${waiterId}`);
$.setActionItem({ raw: { output: data } });
},
});