Edit ExcelImportFlow
This commit is contained in:
@@ -13,8 +13,8 @@ const props = defineProps<{
|
|||||||
|
|
||||||
const emit = defineEmits<{
|
const emit = defineEmits<{
|
||||||
start: [];
|
start: [];
|
||||||
done: [ImportContactsResult | Record<string, unknown>];
|
done: [result: ImportContactsResult];
|
||||||
fail: [string];
|
fail: [message: string];
|
||||||
settled: [];
|
settled: [];
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
@@ -71,7 +71,7 @@ async function postImport(file: File, map?: Record<string, string>) {
|
|||||||
headers: { 'Content-Type': undefined },
|
headers: { 'Content-Type': undefined },
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
return data;
|
return data as ImportContactsResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
function apiMessage(e: unknown, fallback: string) {
|
function apiMessage(e: unknown, fallback: string) {
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ import {
|
|||||||
type PhoneContactDraft,
|
type PhoneContactDraft,
|
||||||
} from '@/lib/phone-contacts';
|
} from '@/lib/phone-contacts';
|
||||||
import type {
|
import type {
|
||||||
|
ImportContactsResult,
|
||||||
LeadDto,
|
LeadDto,
|
||||||
LeadImportJobDto,
|
LeadImportJobDto,
|
||||||
LeadStageDto,
|
LeadStageDto,
|
||||||
@@ -941,8 +942,8 @@ function onExcelImportStart() {
|
|||||||
error.value = '';
|
error.value = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
function onExcelImportDone(result: Record<string, unknown> | LeadImportJobDto) {
|
function onExcelImportDone(result: ImportContactsResult) {
|
||||||
const job = result as LeadImportJobDto;
|
const job = result as unknown as LeadImportJobDto;
|
||||||
if (!job?.id) {
|
if (!job?.id) {
|
||||||
error.value = 'ورود فایل ناموفق بود.';
|
error.value = 'ورود فایل ناموفق بود.';
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user