Edit ExcelImportFlow

This commit is contained in:
2026-09-29 14:57:10 +03:30
parent 66af7e577c
commit 2309e2c5ab
2 changed files with 6 additions and 5 deletions
+3 -3
View File
@@ -13,8 +13,8 @@ const props = defineProps<{
const emit = defineEmits<{
start: [];
done: [ImportContactsResult | Record<string, unknown>];
fail: [string];
done: [result: ImportContactsResult];
fail: [message: string];
settled: [];
}>();
@@ -71,7 +71,7 @@ async function postImport(file: File, map?: Record<string, string>) {
headers: { 'Content-Type': undefined },
},
);
return data;
return data as ImportContactsResult;
}
function apiMessage(e: unknown, fallback: string) {
+3 -2
View File
@@ -28,6 +28,7 @@ import {
type PhoneContactDraft,
} from '@/lib/phone-contacts';
import type {
ImportContactsResult,
LeadDto,
LeadImportJobDto,
LeadStageDto,
@@ -941,8 +942,8 @@ function onExcelImportStart() {
error.value = '';
}
function onExcelImportDone(result: Record<string, unknown> | LeadImportJobDto) {
const job = result as LeadImportJobDto;
function onExcelImportDone(result: ImportContactsResult) {
const job = result as unknown as LeadImportJobDto;
if (!job?.id) {
error.value = 'ورود فایل ناموفق بود.';
return;