From a490b00e1ed7b411f457ab81c93238ab4e938d9b Mon Sep 17 00:00:00 2001 From: Matthew Grove Date: Sat, 28 Oct 2023 23:07:15 +0100 Subject: [PATCH] [FIX] Datatypes and URL changes from API updates Fix URL change Fix datatype errors likely due to API changes --- autosave.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/autosave.php b/autosave.php index 1345150..d1bcaa6 100644 --- a/autosave.php +++ b/autosave.php @@ -173,7 +173,7 @@ function createAutoSaveTransaction(array $group, array $arguments): void 'notes' => 'Created to automatically save money.', ]; // create a link between A and B. - postCurlRequest('/api/v1/transaction_links', $relationSubmission); + postCurlRequest('/api/v1/transaction-links', $relationSubmission); } @@ -219,7 +219,7 @@ function getTransaction(int $journalId): array * @param array $link * @return int */ -function getOpposingTransaction(int $transactionId, array $link): int +function getOpposingTransaction(string $transactionId, array $link): int { $opposingJournal = 0; if ($transactionId === $link['attributes']['inward_id']) { @@ -231,7 +231,7 @@ function getOpposingTransaction(int $transactionId, array $link): int if (0 === $opposingJournal) { messageAndExit('No opposing transaction.'); } - return $opposingJournal; + return (int)$opposingJournal; }