diff --git a/flake.nix b/flake.nix index 1db92a9..c0b6f18 100644 --- a/flake.nix +++ b/flake.nix @@ -42,8 +42,8 @@ domain = "git.wanderingcrow.net"; owner = "TheWanderingCrow"; repo = "actualbudget-report"; - rev = "v1.0"; - hash = "sha256-rt4wiSzsNqmSWGoMBf6fiNpCxZfEPwYlZuClLI+s+A4="; + rev = "v2.0.1"; + hash = "sha256-FytoZUN8g3ilzTa1xKEbsCaZiHHz0QMGVbS+NYow920="; }; vendorHash = "sha256-NHTKwUSIbNCUco88JbHOo3gt6S37ggee+LWNbHaRGEs="; }; diff --git a/main.go b/main.go index 38d12d0..b33a6d5 100644 --- a/main.go +++ b/main.go @@ -114,13 +114,14 @@ func (b BudgetClient) BankSync() bool { func (b BudgetClient) GetBudgetMonths() *BudgetMonthsResponse { currentTime := time.Now() year, month := currentTime.Year(), int(currentTime.Month()) - budgetMonth := fmt.Sprintf("%v-%v", year, month) + budgetMonth := fmt.Sprintf("%v-%02d", year, month) resp := b.callApi("GET", "/months/"+budgetMonth, map[string]string{ "budget-encryption-password": b.encryptionKey, }) defer resp.Body.Close() if resp.StatusCode != http.StatusOK { - log.Fatal("GetBudgetAmounts failed with: " + string(resp.Status)) + temp, _ := io.ReadAll(resp.Body) + log.Fatal("GetBudgetAmounts failed with: " + string(resp.Status) + " " + string(temp)) } var data bytes.Buffer