website refactor
This commit is contained in:
@@ -357,7 +357,7 @@ export const routeMatchers = {
|
||||
export function buildPath(
|
||||
routeName: string,
|
||||
params: Record<string, string> = {},
|
||||
_locale?: string
|
||||
_: string = ''
|
||||
): string {
|
||||
// This is a placeholder for future i18n implementation
|
||||
// For now, it just builds the path using the route config
|
||||
|
||||
@@ -151,6 +151,14 @@ export class SearchParamBuilder {
|
||||
return this;
|
||||
}
|
||||
|
||||
// Wizard params
|
||||
step(value: string | null): this {
|
||||
if (value !== null) {
|
||||
this.params.set('step', value);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
// Generic setter
|
||||
set(key: string, value: string | null): this {
|
||||
if (value !== null) {
|
||||
|
||||
@@ -37,6 +37,10 @@ export interface ParsedFilterParams {
|
||||
tier?: string | null;
|
||||
}
|
||||
|
||||
export interface ParsedWizardParams {
|
||||
step?: string | null;
|
||||
}
|
||||
|
||||
export class SearchParamParser {
|
||||
// Parse auth parameters
|
||||
static parseAuth(params: URLSearchParams): Result<ParsedAuthParams, string> {
|
||||
@@ -172,6 +176,13 @@ export class SearchParamParser {
|
||||
});
|
||||
}
|
||||
|
||||
// Parse wizard parameters
|
||||
static parseWizard(params: URLSearchParams): Result<ParsedWizardParams, string> {
|
||||
return Result.ok({
|
||||
step: params.get('step'),
|
||||
});
|
||||
}
|
||||
|
||||
// Parse all parameters at once
|
||||
static parseAll(params: URLSearchParams): Result<
|
||||
{
|
||||
|
||||
@@ -84,7 +84,7 @@ export class SearchParamValidators {
|
||||
return { isValid: true, errors: [] };
|
||||
}
|
||||
|
||||
static validateOptional(value: string | null): ValidationResult {
|
||||
static validateOptional(_value: string | null): ValidationResult {
|
||||
return { isValid: true, errors: [] };
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user