Merge branch 'feature/doda-endpoints-faltantes' into feature/visible-clicks-csv
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
getDodaAltaStatus,
|
||||
type DodaAltaStatusResponse
|
||||
} from '$lib/api/dashboard/a76/general_catalogs/doda';
|
||||
import type { ApiResponse } from '$lib/api';
|
||||
import { m } from '$lib/i18n/messages';
|
||||
|
||||
let {
|
||||
@@ -14,6 +15,9 @@
|
||||
taskId,
|
||||
dodaId,
|
||||
variant = 'doda',
|
||||
title = m['sidebar.doda_alta.progress_title'](),
|
||||
description = 'Task ID',
|
||||
getStatus = getDodaAltaStatus,
|
||||
onComplete,
|
||||
onCancel
|
||||
}: {
|
||||
@@ -21,6 +25,9 @@
|
||||
taskId: string;
|
||||
dodaId?: number;
|
||||
variant?: 'doda' | 'pita';
|
||||
title?: string;
|
||||
description?: string;
|
||||
getStatus?: (taskId: string) => Promise<ApiResponse<DodaAltaStatusResponse>>;
|
||||
onComplete?: (result: DodaAltaStatusResponse) => void;
|
||||
onCancel?: () => void;
|
||||
} = $props();
|
||||
@@ -84,7 +91,7 @@
|
||||
if (!taskId || !pollingActive || pollInFlight) return;
|
||||
pollInFlight = true;
|
||||
try {
|
||||
const res = await getDodaAltaStatus(taskId);
|
||||
const res = await getStatus(taskId);
|
||||
|
||||
if (res.error) {
|
||||
consecutivePollErrors += 1;
|
||||
@@ -151,8 +158,8 @@
|
||||
<Dialog.Root bind:open>
|
||||
<Dialog.Content class="max-w-md">
|
||||
<Dialog.Header>
|
||||
<Dialog.Title>{m['sidebar.doda_alta.progress_title']()}</Dialog.Title>
|
||||
<Dialog.Description>Alta {variantLabel} — Task ID: {taskId}</Dialog.Description>
|
||||
<Dialog.Title>{title}</Dialog.Title>
|
||||
<Dialog.Description>{description} {variantLabel} — Task ID: {taskId}</Dialog.Description>
|
||||
</Dialog.Header>
|
||||
|
||||
<div class="space-y-4 py-2">
|
||||
|
||||
Reference in New Issue
Block a user