fix(query): set default query retry to 1 (#5743)
* fix(query): set default query retry to 1 * fix(query): don't retry 404s and limit default retries to 3 * feat: expand status skipping checks * feat: parallel fetch v2 and v3 in middleware --------- Co-authored-by: Calum H. (IMB11) <contact@cal.engineer>
This commit is contained in:
@@ -32,10 +32,11 @@ export default defineNuxtRouteMiddleware(async (to) => {
|
||||
const projectId = to.params.id as string
|
||||
|
||||
try {
|
||||
// Fetch v2 project for redirect check AND cache it for the page
|
||||
// Using fetchQuery ensures the page's useQuery gets this cached result
|
||||
const project = await queryClient.fetchQuery(projectQueryOptions.v2(projectId, client))
|
||||
const projectV3 = await queryClient.fetchQuery(projectQueryOptions.v3(projectId, client))
|
||||
// Fetch v2 and v3 in parallel — cache both for the page's useQuery calls
|
||||
const [project, projectV3] = await Promise.all([
|
||||
queryClient.fetchQuery(projectQueryOptions.v2(projectId, client)),
|
||||
queryClient.fetchQuery(projectQueryOptions.v3(projectId, client)),
|
||||
])
|
||||
|
||||
// Let page handle 404
|
||||
if (!project) return
|
||||
|
||||
Reference in New Issue
Block a user