feat(changedetection): add delete watch action
This commit is contained in:
@@ -0,0 +1,29 @@
|
|||||||
|
import defineAction from '../../../../helpers/define-action.js';
|
||||||
|
|
||||||
|
export default defineAction({
|
||||||
|
name: 'Delete a watch',
|
||||||
|
key: 'deleteWatch',
|
||||||
|
description: 'Deletes a change detection watch.',
|
||||||
|
arguments: [
|
||||||
|
{
|
||||||
|
label: 'Watch ID',
|
||||||
|
key: 'watchId',
|
||||||
|
type: 'string',
|
||||||
|
required: true,
|
||||||
|
variables: true,
|
||||||
|
description: 'Watch id you want to delete',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
|
||||||
|
async run($) {
|
||||||
|
const watchId = $.step.parameters.watchId;
|
||||||
|
|
||||||
|
await $.http.delete(`/v1/watch/${watchId}`);
|
||||||
|
|
||||||
|
$.setActionItem({
|
||||||
|
raw: {
|
||||||
|
result: 'successful',
|
||||||
|
},
|
||||||
|
});
|
||||||
|
},
|
||||||
|
});
|
@@ -1,3 +1,4 @@
|
|||||||
import createWatch from './create-watch/index.js';
|
import createWatch from './create-watch/index.js';
|
||||||
|
import deleteWatch from './delete-watch/index.js';
|
||||||
|
|
||||||
export default [createWatch];
|
export default [createWatch, deleteWatch];
|
||||||
|
@@ -3,6 +3,8 @@ favicon: /favicons/changedetection.svg
|
|||||||
items:
|
items:
|
||||||
- name: Create a watch
|
- name: Create a watch
|
||||||
desc: Creates a new change detection watch for a specific website.
|
desc: Creates a new change detection watch for a specific website.
|
||||||
|
- name: Delete a watch
|
||||||
|
desc: Deletes a change detection watch.
|
||||||
---
|
---
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
|
Reference in New Issue
Block a user