Bookability: run date refresh synchronously, update timestamp immediately

Backend now awaits the refresh in a thread executor instead of queuing a
background task, so the response returns only after data is written. Frontend
drops the 3s setTimeout and invalidates the cache immediately on success.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
jtricerolph 2026-07-05 10:08:20 +00:00
parent 7223ae9c30
commit 1612468122
2 changed files with 7 additions and 9 deletions

View file

@ -250,11 +250,8 @@ const Bookability: React.FC = () => {
return res.data
},
onSuccess: () => {
// Refetch after a short delay to allow background task to complete
setTimeout(() => {
queryClient.invalidateQueries({ queryKey: ['rate-matrix'] })
setRefreshingDate(null)
}, 3000)
queryClient.invalidateQueries({ queryKey: ['rate-matrix'] })
setRefreshingDate(null)
},
onError: () => setRefreshingDate(null),
})