fix
This commit is contained in:
@@ -100,7 +100,6 @@
|
||||
|
||||
let syncOpen = $state(false);
|
||||
let syncCompany = $state<AdminOrgCompany | null>(null);
|
||||
let syncWpCategoriesFile = $state<File | null>(null);
|
||||
|
||||
const cloneDestLabel = $derived.by(() => {
|
||||
const selected = cloneDestOptions.find((c) => c.id === cloneDestId);
|
||||
@@ -409,7 +408,6 @@
|
||||
|
||||
function openSyncDialog(company: AdminOrgCompany) {
|
||||
syncCompany = company;
|
||||
syncWpCategoriesFile = null;
|
||||
syncOpen = true;
|
||||
error = "";
|
||||
success = "";
|
||||
@@ -471,8 +469,7 @@
|
||||
const targetName = syncCompany.name;
|
||||
try {
|
||||
const res = await syncAdminCompanyA1(syncCompany.id, {
|
||||
reprocessSampleLimit: 25,
|
||||
wpProductCategoriesFile: syncWpCategoriesFile
|
||||
reprocessSampleLimit: 25
|
||||
});
|
||||
const r = res.result;
|
||||
const mappedWith = Number(r.mapped_with_category ?? 0);
|
||||
@@ -493,7 +490,6 @@
|
||||
});
|
||||
syncOpen = false;
|
||||
syncCompany = null;
|
||||
syncWpCategoriesFile = null;
|
||||
} catch (err) {
|
||||
error = failureMessage(err, i18n.t("flash.admin.syncA1Error", { name: targetName }));
|
||||
} finally {
|
||||
@@ -1130,39 +1126,6 @@
|
||||
{i18n.t("admin.users.syncA1Company", { name: syncCompany.name })}
|
||||
</p>
|
||||
{/if}
|
||||
<div class="space-y-2">
|
||||
<label class="block text-sm font-medium text-foreground" for="sync-a1-wp-categories">
|
||||
{i18n.t("admin.users.syncA1WpUpload")}
|
||||
</label>
|
||||
<input
|
||||
id="sync-a1-wp-categories"
|
||||
type="file"
|
||||
accept=".sql,text/plain,application/sql"
|
||||
class="block w-full text-sm text-foreground file:mr-3 file:rounded-md file:border-0 file:bg-muted file:px-3 file:py-1.5 file:text-sm file:font-medium"
|
||||
disabled={busy}
|
||||
onchange={(e) => {
|
||||
const input = e.currentTarget;
|
||||
syncWpCategoriesFile = input.files?.[0] ?? null;
|
||||
}}
|
||||
/>
|
||||
<p class="text-xs text-muted-foreground">{i18n.t("admin.users.syncA1WpUploadHint")}</p>
|
||||
{#if syncWpCategoriesFile}
|
||||
<div class="flex flex-wrap items-center gap-2 text-xs text-muted-foreground">
|
||||
<span>{syncWpCategoriesFile.name}</span>
|
||||
<Button
|
||||
type="button"
|
||||
variant="outline"
|
||||
size="sm"
|
||||
disabled={busy}
|
||||
onclick={() => {
|
||||
syncWpCategoriesFile = null;
|
||||
}}
|
||||
>
|
||||
{i18n.t("admin.users.syncA1WpUploadClear")}
|
||||
</Button>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
<p class="text-sm text-muted-foreground">
|
||||
{i18n.t("admin.users.syncA1Warning")}
|
||||
</p>
|
||||
@@ -1174,7 +1137,6 @@
|
||||
onclick={() => {
|
||||
syncOpen = false;
|
||||
syncCompany = null;
|
||||
syncWpCategoriesFile = null;
|
||||
}}
|
||||
>
|
||||
{i18n.t("admin.users.syncA1Cancel")}
|
||||
|
||||
Reference in New Issue
Block a user