Fix intensity minutes URL to use path parameters
All checks were successful
Deploy / deploy (push) Successful in 1m38s
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:
@@ -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",
|
||||||
|
|||||||
@@ -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),
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user