[WEB-3066] refactor: replace Space Services with Services Package (#6353)
* [WEB-3066] refactor: replace Space Services with Services Package * chore: minor improvements * fix: type --------- Co-authored-by: sriram veeraghanta <veeraghanta.sriram@gmail.com>
This commit is contained in:
parent
39ca600091
commit
ade4d290f5
66 changed files with 1002 additions and 631 deletions
|
|
@ -34,7 +34,19 @@ export abstract class APIService {
|
|||
(error) => {
|
||||
if (error.response && error.response.status === 401) {
|
||||
const currentPath = window.location.pathname;
|
||||
window.location.replace(`/${currentPath ? `?next_path=${currentPath}` : ``}`);
|
||||
let prefix = "";
|
||||
let updatedPath = currentPath;
|
||||
|
||||
// Check for special path prefixes
|
||||
if (currentPath.startsWith("/god-mode")) {
|
||||
prefix = "/god-mode";
|
||||
updatedPath = currentPath.replace("/god-mode", "");
|
||||
} else if (currentPath.startsWith("/spaces")) {
|
||||
prefix = "/spaces";
|
||||
updatedPath = currentPath.replace("/spaces", "");
|
||||
}
|
||||
|
||||
window.location.replace(`${prefix}${updatedPath ? `?next_path=${updatedPath}` : ""}`);
|
||||
}
|
||||
return Promise.reject(error);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue