Skip to content

Commit

Permalink
Fix API extra params
Browse files Browse the repository at this point in the history
  • Loading branch information
third774 committed Feb 20, 2025
1 parent 817540e commit de8562b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .changeset/chilly-cougars-agree.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"partytracks": patch
---

Fix API extra params
10 changes: 5 additions & 5 deletions packages/partytracks/src/client/PartyTracks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ export class PartyTracks {
async createSession(peerConnection: RTCPeerConnection) {
logger.debug("🆕 creating new session");
const response = await this.fetchWithRecordedHistory(
`${this.config.prefix}/sessions/new${this.#params}`,
`${this.config.prefix}/sessions/new?${this.#params}`,
{ method: "POST" }
);
if (response.status > 400) {
Expand Down Expand Up @@ -286,7 +286,7 @@ export class PartyTracks {
}))
};
const response = await this.fetchWithRecordedHistory(
`${this.config.prefix}/sessions/${sessionId}/tracks/new${this.#params}`,
`${this.config.prefix}/sessions/${sessionId}/tracks/new?${this.#params}`,
{
method: "POST",
body: JSON.stringify(requestBody)
Expand Down Expand Up @@ -426,7 +426,7 @@ export class PartyTracks {
this.taskScheduler.schedule(async () => {
const newTrackResponse: TracksResponse =
await this.fetchWithRecordedHistory(
`${this.config.prefix}/sessions/${sessionId}/tracks/new${this.#params}`,
`${this.config.prefix}/sessions/${sessionId}/tracks/new?${this.#params}`,
{
method: "POST",
body: JSON.stringify({
Expand Down Expand Up @@ -470,7 +470,7 @@ export class PartyTracks {

const renegotiationResponse =
await this.fetchWithRecordedHistory(
`${this.config.prefix}/sessions/${sessionId}/renegotiate${this.#params}`,
`${this.config.prefix}/sessions/${sessionId}/renegotiate?${this.#params}`,
{
method: "PUT",
body: JSON.stringify({
Expand Down Expand Up @@ -571,7 +571,7 @@ export class PartyTracks {
force: false
};
const response = await this.fetchWithRecordedHistory(
`${this.config.prefix}/sessions/${sessionId}/tracks/close${this.#params}`,
`${this.config.prefix}/sessions/${sessionId}/tracks/close?${this.#params}`,
{
method: "PUT",
body: JSON.stringify(requestBody)
Expand Down

0 comments on commit de8562b

Please sign in to comment.