feat(xero): add new bank transactions trigger

This commit is contained in:
Rıdvan Akca
2023-11-08 17:40:58 +03:00
parent e79fc9cae4
commit 1a4ba35ef4
7 changed files with 110 additions and 0 deletions

View File

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

View File

@@ -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;
},
};