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:
parent
7223ae9c30
commit
1612468122
2 changed files with 7 additions and 9 deletions
|
|
@ -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),
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue