Skip to content

Commit

Permalink
admin: set session defining grid from panel
Browse files Browse the repository at this point in the history
  • Loading branch information
Cadiducho committed Oct 26, 2024
1 parent e866f9a commit 8fb2099
Show file tree
Hide file tree
Showing 3 changed files with 588 additions and 442 deletions.
9 changes: 6 additions & 3 deletions src/_services/session.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,14 @@ export class SessionService extends PrognoService<IRaceSession, RaceSession> {
return this.postObjectToAPI(`/gps/${gp.competition.id}/${gp.season.id}/${gp.id}/sessions`, data);
}

public async updateSessionInGrandPrix(gp: GrandPrix, session: RaceSession): Promise<Array<RaceSession>> {
return await axios.put(`/gps/${gp.competition.id}/${gp.season.id}/${gp.id}/sessions/${session.id}`, session);
public async updateSessionInGrandPrix(gp: GrandPrix, session: RaceSession, data: {
date: Date;
defineGridOf: number[]
}): Promise<Array<RaceSession>> {
return await axios.put(`/gps/${gp.competition.id}/${gp.season.id}/${gp.id}/sessions/${session.id}`, data);
}

public async removeSessionFromGrandPrix(gp: GrandPrix, session: RaceSession): Promise<Array<RaceSession>> {
return await axios.delete(`/gps/${gp.competition.id}/${gp.season.id}/${gp.id}/sessions/${session.id}`);
}
}
}
Loading

0 comments on commit 8fb2099

Please sign in to comment.