This commit is contained in:
2026-08-16 12:00:28 +02:00
parent 52f27e30fc
commit 52fb129957
7 changed files with 105 additions and 23 deletions
@@ -378,6 +378,7 @@
});
const products = Number(res.counts?.raw_products ?? 0);
const categories = Number(res.counts?.categories ?? 0);
const activeDest = (res.active_company_id || res.dest_company_id || "").trim();
success = i18n.t("flash.admin.catalogCloned", {
source: cloneCompany.name,
dest: cloneDestLabel,
@@ -386,6 +387,18 @@
});
cloneOpen = false;
cloneCompany = null;
if (activeDest) {
try {
await api("/api/auth/select-company", {
method: "POST",
body: { company_id: activeDest }
});
} catch {
/* clone handler may already have switched the session */
}
window.location.assign("/products");
return;
}
} catch (err) {
error = failureMessage(err, "Clone catalog failed");
} finally {