Skip to content

Commit

Permalink
Use ClientUrl as absolute URL to work on Portals
Browse files Browse the repository at this point in the history
  • Loading branch information
DigitalFlow authored Mar 31, 2023
1 parent 0052e1e commit 46f78a5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/js/WebApiClient.Core.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,6 @@
return context.getClientUrl();
}

if (WebApiClient.ClientUrl) {
return WebApiClient.ClientUrl;
}

throw new Error("Failed to retrieve client url, is ClientGlobalContext.aspx available?");
}

Expand Down Expand Up @@ -704,6 +700,10 @@
* @return {String}
*/
WebApiClient.GetApiUrl = function() {
if (WebApiClient.ClientUrl) {
return WebApiClient.ClientUrl;
}

return GetClientUrl() + "/api/data/v" + WebApiClient.ApiVersion + "/";
};

Expand Down

0 comments on commit 46f78a5

Please sign in to comment.