fix: keep payment user cards in payments

This commit is contained in:
3252a8
2026-05-24 09:32:47 +03:00
parent aa65972483
commit 29b6e6eb24
5 changed files with 64 additions and 7 deletions
+12
View File
@@ -62,6 +62,14 @@ export function adminPaymentIdFromPath(pathname) {
return m ? Number(m[1]) : null;
}
export function adminPaymentsUserIdFromPath(pathname) {
const normalized = String(pathname || "")
.toLowerCase()
.replace(/\/+$/, "");
const m = normalized.match(/^\/admin\/payments\/users\/(-?\d+)$/);
return m ? Number(m[1]) : null;
}
export function supportTicketIdFromPath(pathname) {
const normalized = String(pathname || "")
.toLowerCase()
@@ -89,8 +97,12 @@ export function syncSectionPath(section, replace = false, adminSection = null, a
const supportTicketId =
adm === "support" ? adminSupportTicketIdFromPath(window.location.pathname) : null;
const paymentId = adm === "payments" ? adminPaymentIdFromPath(window.location.pathname) : null;
const paymentUserId =
adm === "payments" ? adminPaymentsUserIdFromPath(window.location.pathname) : null;
if (adm === "users" && uid) targetPath = `/admin/users/${uid}`;
else if (adm === "support" && supportTicketId) targetPath = `/admin/support/${supportTicketId}`;
else if (adm === "payments" && paymentUserId)
targetPath = `/admin/payments/users/${paymentUserId}`;
else if (adm === "payments" && paymentId) targetPath = `/admin/payments/${paymentId}`;
else targetPath = `/admin/${adm}`;
}