Skip to content

Commit

Permalink
revert
Browse files Browse the repository at this point in the history
  • Loading branch information
s1adem4n committed Jul 31, 2023
1 parent c6f75f0 commit 165cbcf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
4 changes: 1 addition & 3 deletions src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ export class API {
public clientID: string,
public oauthToken: string,
public apiURL: string = "https://api-v2.soundcloud.com",
public fetchFn = fetch,
) {
API.headers.Authorization = `OAuth ${oauthToken}`;
}
Expand All @@ -30,9 +29,8 @@ export class API {
url.search = `?client_id=${this.clientID}`;
}

const response = await this.fetchFn(url.toString(), {
const response = await fetch(url.toString(), {
headers: API.headers,
method: "GET",
});
if (!response.ok) {
throw new Error(
Expand Down
3 changes: 1 addition & 2 deletions src/soundcloud.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,10 @@ export class Soundcloud {
clientID: string,
oauthToken: string,
apiURL = "https://api-v2.soundcloud.com",
fetchFn = fetch,
) {
Soundcloud.clientID = clientID;
Soundcloud.oauthToken = oauthToken;
this.api = new API(clientID, oauthToken, apiURL, fetchFn);
this.api = new API(clientID, oauthToken, apiURL);
}
}

Expand Down

0 comments on commit 165cbcf

Please sign in to comment.