feat(xero): add new bank transactions trigger
This commit is contained in:
3
packages/backend/src/apps/xero/dynamic-data/index.ts
Normal file
3
packages/backend/src/apps/xero/dynamic-data/index.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
import listOrganizations from './list-organizations';
|
||||
|
||||
export default [listOrganizations];
|
@@ -0,0 +1,27 @@
|
||||
import { IGlobalVariable, IJSONObject } from '@automatisch/types';
|
||||
|
||||
export default {
|
||||
name: 'List organizations',
|
||||
key: 'listOrganizations',
|
||||
|
||||
async run($: IGlobalVariable) {
|
||||
const organizations: {
|
||||
data: IJSONObject[];
|
||||
} = {
|
||||
data: [],
|
||||
};
|
||||
|
||||
const { data } = await $.http.get('/api.xro/2.0/Organisation');
|
||||
|
||||
if (data.Organisations?.length) {
|
||||
for (const organization of data.Organisations) {
|
||||
organizations.data.push({
|
||||
value: organization.OrganisationID,
|
||||
name: organization.Name,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
return organizations;
|
||||
},
|
||||
};
|
Reference in New Issue
Block a user