feat(pipedrive): add create activity action
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import listActivityTypes from './list-activity-types';
|
||||
import listCurrencies from './list-currencies';
|
||||
import listDeals from './list-deals';
|
||||
import listLeads from './list-leads';
|
||||
@@ -6,6 +7,7 @@ import listPersons from './list-persons';
|
||||
import listUsers from './list-users';
|
||||
|
||||
export default [
|
||||
listActivityTypes,
|
||||
listCurrencies,
|
||||
listDeals,
|
||||
listLeads,
|
||||
|
@@ -0,0 +1,33 @@
|
||||
import { IGlobalVariable, IJSONObject } from '@automatisch/types';
|
||||
|
||||
export default {
|
||||
name: 'List activity types',
|
||||
key: 'listActivityTypes',
|
||||
|
||||
async run($: IGlobalVariable) {
|
||||
const activityTypes: {
|
||||
data: IJSONObject[];
|
||||
} = {
|
||||
data: [],
|
||||
};
|
||||
|
||||
const { data } = await $.http.get(
|
||||
`${$.auth.data.apiDomain}/api/v1/activityTypes`
|
||||
);
|
||||
|
||||
if (!data?.data) {
|
||||
return { data: [] };
|
||||
}
|
||||
|
||||
if (data.data.length) {
|
||||
for (const activityType of data.data) {
|
||||
activityTypes.data.push({
|
||||
value: activityType.key_string,
|
||||
name: activityType.name,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
return activityTypes;
|
||||
},
|
||||
};
|
Reference in New Issue
Block a user