Skip to content

Commit 8e10f84

Browse files
committed
Refactor Xero Accounting API actions for consistency and clarity. Key changes include:
- Updated `listInvoices`, `listManualJournals`, `listCreditNotes`, and `listContacts` methods to use `modifiedSince` instead of `modifiedAfter` for parameter naming consistency. - Simplified API request paths for `listInvoices` and `listManualJournals` by removing unnecessary identifiers. These modifications enhance the clarity and maintainability of the API integration.
1 parent 398aec8 commit 8e10f84

File tree

6 files changed

+9
-12
lines changed

6 files changed

+9
-12
lines changed

components/xero_accounting_api/actions/list-contacts/list-contacts.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export default {
5656
const response = await this.xeroAccountingApi.listContacts({
5757
$,
5858
tenantId: this.tenantId,
59-
modifiedAfter: this.modifiedAfter,
59+
modifiedSince: this.modifiedAfter,
6060
params: {
6161
IDs: this.ids,
6262
Where: this.where,

components/xero_accounting_api/actions/list-credit-notes/list-credit-notes.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export default {
4444
const response = await this.xeroAccountingApi.listCreditNotes({
4545
$,
4646
tenantId: this.tenantId,
47-
modifiedAfter: this.modifiedAfter,
47+
modifiedSince: this.modifiedAfter,
4848
params: {
4949
Where: this.where,
5050
order: this.order,

components/xero_accounting_api/actions/list-invoices/list-invoices.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ export default {
7474
const response = await this.xeroAccountingApi.listInvoices({
7575
$,
7676
tenantId: this.tenantId,
77-
modifiedAfter: this.modifiedAfter,
77+
modifiedSince: this.modifiedSince,
7878
params: {
7979
IDs: this.ids,
8080
InvoiceNumbers: this.invoiceNumbers,

components/xero_accounting_api/actions/list-manual-journals/list-manual-journals.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export default {
4444
const response = await this.xeroAccountingApi.listManualJournals({
4545
$,
4646
tenantId: this.tenantId,
47-
modifiedAfter: this.modifiedAfter,
47+
modifiedSince: this.modifiedAfter,
4848
params: {
4949
Where: this.where,
5050
order: this.order,

components/xero_accounting_api/actions/make-an-api-call/make-an-api-call.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ export default {
5656
method: this.requestMethod,
5757
path: this.relativeUrl,
5858
params: this.queryString,
59+
tenantId: this.tenantId,
5960
data: parseObject(this.requestBody),
6061
});
6162

components/xero_accounting_api/xero_accounting_api.app.mjs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -344,19 +344,15 @@ export default {
344344
...opts,
345345
});
346346
},
347-
listInvoices({
348-
invoiceIdentifier, ...opts
349-
}) {
347+
listInvoices(opts = {}) {
350348
return this._makeRequest({
351-
path: `/Invoices/${invoiceIdentifier}`,
349+
path: "/Invoices",
352350
...opts,
353351
});
354352
},
355-
listManualJournals({
356-
manualJournalId, ...opts
357-
}) {
353+
listManualJournals(opts = {}) {
358354
return this._makeRequest({
359-
path: `/ManualJournals/${manualJournalId}`,
355+
path: "/ManualJournals",
360356
...opts,
361357
});
362358
},

0 commit comments

Comments
 (0)