feat: new client onboarding wizard (3-step); fix ticket status refresh after update
This commit is contained in:
@@ -72,11 +72,11 @@ export default function TicketDetailScreen() {
|
||||
body: `Status changed to ${status.replace('_', ' ')} by ${who}`,
|
||||
}).catch(() => {});
|
||||
},
|
||||
onSuccess: () => {
|
||||
onSuccess: async () => {
|
||||
setShowStatusPicker(false);
|
||||
qc.invalidateQueries({ queryKey: ['task', id] });
|
||||
qc.invalidateQueries({ queryKey: ['tasks'] });
|
||||
refetch();
|
||||
await qc.invalidateQueries({ queryKey: ['task', id] });
|
||||
await qc.invalidateQueries({ queryKey: ['tasks'] });
|
||||
await refetch();
|
||||
},
|
||||
onError: () => Alert.alert('Error', 'Could not update status.'),
|
||||
});
|
||||
@@ -137,9 +137,10 @@ export default function TicketDetailScreen() {
|
||||
|
||||
setInstNotes('');
|
||||
setCoords(null);
|
||||
// Invalidate all caches then go back to list — avoids stale UI on current screen
|
||||
// Invalidate + force refetch so the status shows RESOLVED immediately
|
||||
await qc.invalidateQueries({ queryKey: ['tasks'] });
|
||||
await qc.invalidateQueries({ queryKey: ['task', id] });
|
||||
await refetch();
|
||||
await qc.invalidateQueries({ queryKey: ['client', ticket?.clientId] });
|
||||
await qc.invalidateQueries({ queryKey: ['client-tickets', ticket?.clientId] });
|
||||
Alert.alert(
|
||||
|
||||
Reference in New Issue
Block a user