fix: Fix error with deep links trying to parse empty query parameters.

This commit is contained in:
2025-08-10 18:37:07 -06:00
parent bcbb80e034
commit e0b9481be5
2 changed files with 2 additions and 6 deletions

View File

@@ -33,7 +33,6 @@ export const deepLinkSchemas = {
id: z.string(), id: z.string(),
}), }),
"claim-add-raw": z.object({ "claim-add-raw": z.object({
id: z.string(),
claim: z.string().optional(), claim: z.string().optional(),
claimJwtId: z.string().optional(), claimJwtId: z.string().optional(),
}), }),

View File

@@ -201,10 +201,9 @@ export class DeepLinkHandler {
// Continue with parameter validation as before... // Continue with parameter validation as before...
const schema = deepLinkSchemas[path as keyof typeof deepLinkSchemas]; const schema = deepLinkSchemas[path as keyof typeof deepLinkSchemas];
let validatedParams, validatedQuery; let validatedParams;
try { try {
validatedParams = await schema.parseAsync(params); validatedParams = await schema.parseAsync(params);
validatedQuery = await schema.parseAsync(query);
} catch (error) { } catch (error) {
// For parameter validation errors, provide specific error feedback // For parameter validation errors, provide specific error feedback
logConsoleAndDb( logConsoleAndDb(
@@ -230,11 +229,10 @@ export class DeepLinkHandler {
await this.router.replace({ await this.router.replace({
name: routeName, name: routeName,
params: validatedParams, params: validatedParams,
query: validatedQuery,
}); });
} catch (error) { } catch (error) {
logConsoleAndDb( logConsoleAndDb(
`[DeepLink] Error routing to route name ${routeName} for path: ${path}: ${JSON.stringify(error)} ... with validated params: ${JSON.stringify(validatedParams)} ... and validated query: ${JSON.stringify(validatedQuery)}`, `[DeepLink] Error routing to route name ${routeName} for path: ${path}: ${JSON.stringify(error)} ... with validated params: ${JSON.stringify(validatedParams)}`,
true, true,
); );
// For parameter validation errors, provide specific error feedback // For parameter validation errors, provide specific error feedback
@@ -245,7 +243,6 @@ export class DeepLinkHandler {
originalPath: path, originalPath: path,
errorCode: "ROUTING_ERROR", errorCode: "ROUTING_ERROR",
errorMessage: `Error routing to ${routeName}: ${JSON.stringify(error)}`, errorMessage: `Error routing to ${routeName}: ${JSON.stringify(error)}`,
...validatedQuery,
}, },
}); });
} }