Fix intensity minutes URL to use path parameters
All checks were successful
Deploy / deploy (push) Successful in 1m38s

The Garmin API uses path parameters, not query parameters:
- Correct: /usersummary-service/stats/im/weekly/{start}/{end}
- Wrong: /usersummary-service/stats/im/weekly?start=...&end=...

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-15 14:09:46 +00:00
parent cf89675b92
commit 83fd29b6c6
2 changed files with 2 additions and 2 deletions

View File

@@ -473,7 +473,7 @@ describe("fetchIntensityMinutes", () => {
expect(result).toBe(75); expect(result).toBe(75);
expect(global.fetch).toHaveBeenCalledWith( expect(global.fetch).toHaveBeenCalledWith(
"https://connectapi.garmin.com/usersummary-service/stats/im/weekly?start=2024-01-08&end=2024-01-15", "https://connectapi.garmin.com/usersummary-service/stats/im/weekly/2024-01-08/2024-01-15",
expect.objectContaining({ expect.objectContaining({
headers: expect.objectContaining({ headers: expect.objectContaining({
Authorization: "Bearer test-token", Authorization: "Bearer test-token",

View File

@@ -190,7 +190,7 @@ export async function fetchIntensityMinutes(
const startDate = startDateObj.toISOString().split("T")[0]; const startDate = startDateObj.toISOString().split("T")[0];
const response = await fetch( const response = await fetch(
`${GARMIN_API_URL}/usersummary-service/stats/im/weekly?start=${startDate}&end=${endDate}`, `${GARMIN_API_URL}/usersummary-service/stats/im/weekly/${startDate}/${endDate}`,
{ {
headers: getGarminHeaders(oauth2Token), headers: getGarminHeaders(oauth2Token),
}, },