view data fixes
Some checks failed
Contract Testing / contract-tests (pull_request) Failing after 7m11s
Contract Testing / contract-snapshot (pull_request) Has been skipped

This commit is contained in:
2026-01-24 23:29:55 +01:00
parent c1750a33dd
commit 1b0a1f4aee
134 changed files with 10380 additions and 415 deletions

View File

@@ -6,6 +6,12 @@ import { AuthPageService } from '@/lib/services/auth/AuthPageService';
import { ResetPasswordViewData } from '@/lib/view-data/ResetPasswordViewData';
export class ResetPasswordPageQuery implements PageQuery<ResetPasswordViewData, URLSearchParams | Record<string, string | string[] | undefined>> {
private readonly authService: AuthPageService;
constructor(authService?: AuthPageService) {
this.authService = authService || new AuthPageService();
}
async execute(searchParams: URLSearchParams | Record<string, string | string[] | undefined>): Promise<Result<ResetPasswordViewData, string>> {
// Parse and validate search parameters
const parsedResult = SearchParamParser.parseAuth(searchParams);
@@ -17,7 +23,7 @@ export class ResetPasswordPageQuery implements PageQuery<ResetPasswordViewData,
try {
// Use service to process parameters
const authService = new AuthPageService();
const authService = this.authService;
const serviceResult = await authService.processResetPasswordParams({ returnTo, token });
if (serviceResult.isErr()) {
@@ -27,8 +33,9 @@ export class ResetPasswordPageQuery implements PageQuery<ResetPasswordViewData,
// Transform to ViewData using builder
const viewData = ResetPasswordViewDataBuilder.build(serviceResult.unwrap());
return Result.ok(viewData);
} catch (error: any) {
return Result.err(error.message || 'Failed to execute reset password page query');
} catch (error: unknown) {
const message = error instanceof Error ? error.message : 'Failed to execute reset password page query';
return Result.err(message);
}
}