Skip to content

Commit

Permalink
Added more 401 fallbacks to ajax requests
Browse files Browse the repository at this point in the history
  • Loading branch information
drfho authored Feb 20, 2025
1 parent 09a4a06 commit 4d90778
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Products/zms/plugins/www/object/manage_menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@ function zmiSelectObject(sender) {
window.parent.manage_main.htmx.ajax("GET", manage_main_href, 'body')
.then(() => {
// Listen for the htmx response event
window.parent.manage_main.htmx.on("htmx:sendError", function(e) {
const manage_main_href = e.detail.pathInfo.finalRequestPath;
if (window.parent.manage_main) {
window.parent.manage_main.location.assign(manage_main_href);
} else {
window.location.assign(manage_main_href + '&dtpref_sitemap=1');
}
});
window.parent.manage_main.htmx.on('htmx:afterOnLoad', (event) => {
let response = event.detail.xhr;
if (response.status === 200) {
Expand Down

0 comments on commit 4d90778

Please sign in to comment.