feat(clickup): add new lists trigger

This commit is contained in:
Rıdvan Akca
2024-02-14 12:39:22 +03:00
committed by Ali BARIN
parent b4cc7f4d81
commit 6c11bfe93d
5 changed files with 163 additions and 2 deletions

View File

@@ -1,4 +1,5 @@
import listFolders from './list-folders/index.js';
import listSpaces from './list-spaces/index.js';
import listWorkspaces from './list-workspaces/index.js';
export default [listSpaces, listWorkspaces];
export default [listFolders, listSpaces, listWorkspaces];

View File

@@ -0,0 +1,28 @@
export default {
name: 'List folders',
key: 'listFolders',
async run($) {
const folders = {
data: [],
};
const spaceId = $.step.parameters.spaceId;
if (!spaceId) {
return folders;
}
const { data } = await $.http.get(`/v2/space/${spaceId}/folder`);
if (data.folders) {
for (const folder of data.folders) {
folders.data.push({
value: folder.id,
name: folder.name,
});
}
}
return folders;
},
};