From d6258fc02d6c90d7a8ad8ed2fd6dc2d2a401e9ce Mon Sep 17 00:00:00 2001 From: Nemo Date: Tue, 24 Mar 2026 13:28:35 +0800 Subject: [PATCH] fix: onboarding address required fallback; ticket staleTime:0 for instant status refresh --- app/(app)/clients/new.tsx | 6 +++--- app/(app)/tasks/[id].tsx | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/(app)/clients/new.tsx b/app/(app)/clients/new.tsx index 1e4132a..85409dc 100644 --- a/app/(app)/clients/new.tsx +++ b/app/(app)/clients/new.tsx @@ -135,9 +135,9 @@ export default function NewClientScreen() { firstName: firstName.trim(), lastName: lastName.trim(), phone: phone.trim(), - ...(email.trim() ? { email: email.trim() } : {}), - ...(address.trim() ? { address: address.trim() } : {}), - ...(areaId ? { areaId } : {}), + address: address.trim() || '—', // API requires non-empty address + ...(email.trim() ? { email: email.trim() } : {}), + ...(areaId ? { areaId } : {}), }); const client = clientRes.data; diff --git a/app/(app)/tasks/[id].tsx b/app/(app)/tasks/[id].tsx index 96fb297..bce78ed 100644 --- a/app/(app)/tasks/[id].tsx +++ b/app/(app)/tasks/[id].tsx @@ -67,6 +67,7 @@ export default function TicketDetailScreen() { const { data: ticket, isLoading, refetch } = useQuery({ queryKey: ['task', id], queryFn: () => api.get(`/api/v1/tickets/${id}`).then(r => r.data), + staleTime: 0, }); // Fetch client with subscriptions when ticket loads (for prepaid gate)