Skip to content

Commit

Permalink
Improved: added baseURL check, starts with 'http' and includes '/api'(#…
Browse files Browse the repository at this point in the history
  • Loading branch information
R-Sourabh committed Mar 15, 2024
1 parent ad45393 commit b6698b2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/services/UserService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const login = async (username: string, password: string): Promise <any> => {

const checkPermission = async (payload: any): Promise <any> => {
let baseURL = store.getters['user/getInstanceUrl'];
baseURL = baseURL && baseURL.startsWith('http') ? baseURL : `https://${baseURL}.hotwax.io/api/`;
baseURL = baseURL && baseURL.startsWith('http') ? (baseURL.includes('/api') ? baseURL : `${baseURL}/api/`) : `https://${baseURL}.hotwax.io/api/`;
return client({
url: "checkPermission",
method: "post",
Expand Down

0 comments on commit b6698b2

Please sign in to comment.