Skip to content

Commit

Permalink
feat(activities): add support for retrieving activity photos (#44)
Browse files Browse the repository at this point in the history
  • Loading branch information
rhutchison committed Mar 22, 2021
1 parent 6fc5ca7 commit 82fd922
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion src/resources/activities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
DetailedActivity,
Lap,
SummaryActivity,
SummaryAthlete,
SummaryAthlete
} from '../models'
import { Request } from '../request'

Expand Down Expand Up @@ -41,6 +41,13 @@ type GetLapsByActivityIdRequest = {
id: number
}

type GetPhotosByActivityIdRequest = {
id: number
photo_sources?: boolean
size?: number
}


type GetZonesByActivityIdRequest = {
id: number
}
Expand Down Expand Up @@ -125,6 +132,17 @@ export class Activities {
)
}

async getPhotosByActivityId(
params: GetPhotosByActivityIdRequest,
): Promise<Lap[]> {
const { id, ...query } = params
return await this.request.makeApiRequest<Lap[]>(
'get',
`/activities/${id}/photos`,
{ query },
)
}

async getLoggedInAthleteActivities(
params?: GetLoggedInAthleteActivitiesRequest,
): Promise<SummaryActivity[]> {
Expand Down

0 comments on commit 82fd922

Please sign in to comment.