mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Extra code for #1668
This commit is contained in:
@@ -50,17 +50,19 @@ class GetBudgetsRequest extends YnabRequest
|
||||
Log::debug(sprintf('URI is %s', $uri));
|
||||
|
||||
$result = $this->authenticatedGetRequest($uri, []);
|
||||
//Log::debug('Raw GetBudgetsRequest result', $result);
|
||||
Log::debug('Raw GetBudgetsRequest result', $result);
|
||||
|
||||
// expect data in [data][budgets]
|
||||
$rawBudgets = $result['data']['budgets'] ?? [];
|
||||
$freshBudgets = [];
|
||||
foreach ($rawBudgets as $rawBudget) {
|
||||
Log::debug('Raw content of budget is:', $rawBudget);
|
||||
Log::debug(sprintf('Raw content of budget is: %s', json_encode($rawBudget, true)));
|
||||
Log::debug(sprintf('Content of currency format is: %s', json_encode($rawBudget['currency_format'] ?? [], true)));
|
||||
Log::debug(sprintf('ISO code is: %s', $rawBudget['currency_format']['iso_code'] ?? '(none)'));
|
||||
$freshBudgets[] = [
|
||||
'id' => $rawBudget['id'],
|
||||
'name' => $rawBudget['name'],
|
||||
'currency_code' => $rawBudget['currency_format']['iso_code'] ?? 'EUR',
|
||||
'currency_code' => $rawBudget['currency_format']['iso_code'] ?? null,
|
||||
];
|
||||
}
|
||||
$this->budgets = $freshBudgets;
|
||||
|
||||
@@ -74,6 +74,7 @@ abstract class YnabRequest
|
||||
}
|
||||
try {
|
||||
$content = trim($res->getBody()->getContents());
|
||||
Log::debug(sprintf('Raw body is: %s', $content));
|
||||
} catch (RuntimeException $e) {
|
||||
Log::error($e->getMessage());
|
||||
Log::error($e->getTraceAsString());
|
||||
|
||||
Reference in New Issue
Block a user