feat(pipedrive): add create deal action
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
import { IGlobalVariable, IJSONObject } from '@automatisch/types';
|
||||
|
||||
export default {
|
||||
name: 'List users',
|
||||
key: 'listUsers',
|
||||
|
||||
async run($: IGlobalVariable) {
|
||||
const users: {
|
||||
data: IJSONObject[];
|
||||
} = {
|
||||
data: [],
|
||||
};
|
||||
|
||||
const { data } = await $.http.get(`${$.auth.data.apiDomain}/api/v1/users`);
|
||||
|
||||
if (data.data.length) {
|
||||
for (const user of data.data) {
|
||||
users.data.push({
|
||||
value: user.id,
|
||||
name: user.name,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
return users;
|
||||
},
|
||||
};
|
Reference in New Issue
Block a user