Pythe1337N / garmin-connect

Makes it simple to interface with Garmin Connect to get or set any data point.
MIT License
145 stars 60 forks source link

Fix Running activity type #79

Open diegoevangelisti opened 5 months ago

diegoevangelisti commented 5 months ago

Minor fix for Running activity type since it was defined as street_running but it needs to be running instead.

BEFORE

Request

app.get("/activities", async (_, res: Response) => {
  try {
    const activities = await GCClient.getActivities(
      0,
      10,
      ActivityType.Running // "running_outdoor"
    );
    res.status(200).send(JSON.stringify(activities));
  } catch (e) {
    res.status(400).send(e);
  }
});

Response:

ERROR: (400), Bad Request, {"message":"Activity type cannot be an activity sub type","error":"BadRequestException"}
Screenshot 2024-06-23 at 21 47 14

AFTER

Request

app.get("/activities", async (_, res: Response) => {
  try {
    const activities = await GCClient.getActivities(
      0,
      10,
      "running"
    );
    res.status(200).send(JSON.stringify(activities));
  } catch (e) {
    res.status(400).send(e);
  }
});

Response:

Screenshot 2024-06-23 at 21 46 53