Skip to content

Commit

Permalink
fix: getAccountUrl endpoint error (#24)
Browse files Browse the repository at this point in the history
  • Loading branch information
SamYSF authored Mar 31, 2024
1 parent 2900f47 commit d95791f
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/sdk.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,18 @@ class Sdk {
.catch((error) => console.error(error));
}

getAccountUrl() {
const endpoint = this.config.endpoint;
return `${endpoint}/api/get-account`;
async getAccountUrl() {
try {
const endpointData = await getStorageData("endpoint");
const endpoint = endpointData.endpoint;
return `${endpoint}/api/get-account`;
} catch (error) {
console.error('Error fetching endpoint:', error);
}
}

getAccount(accessToken) {
const accountUrl = this.getAccountUrl();
async getAccount(accessToken) {
const accountUrl = await this.getAccountUrl();
const requestConfig = {
method: "GET",
async: true,
Expand Down

0 comments on commit d95791f

Please sign in to comment.