fix
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user