feat(bigin-by-zoho-crm): add new contacts trigger

This commit is contained in:
Rıdvan Akca
2024-02-20 14:16:04 +03:00
parent b7e38f9d1c
commit 282b2374a2
8 changed files with 136 additions and 0 deletions

View File

@@ -0,0 +1,3 @@
import listOrganizations from './list-organizations/index.js';
export default [listOrganizations];

View File

@@ -0,0 +1,23 @@
export default {
name: 'List organizations',
key: 'listOrganizations',
async run($) {
const organizations = {
data: [],
};
const { data } = await $.http.get('/bigin/v2/org');
if (data.org) {
for (const org of data.org) {
organizations.data.push({
value: org.id,
name: org.company_name,
});
}
}
return organizations;
},
};