website refactor
This commit is contained in:
@@ -1,10 +1,3 @@
|
||||
/**
|
||||
* Reset Password Page Query
|
||||
*
|
||||
* Composes data for the reset password page using RSC pattern.
|
||||
* No business logic, only data composition.
|
||||
*/
|
||||
|
||||
import { Result } from '@/lib/contracts/Result';
|
||||
import { PageQuery } from '@/lib/contracts/page-queries/PageQuery';
|
||||
import { ResetPasswordViewDataBuilder } from '@/lib/builders/view-data/ResetPasswordViewDataBuilder';
|
||||
@@ -28,14 +21,14 @@ export class ResetPasswordPageQuery implements PageQuery<ResetPasswordViewData,
|
||||
const serviceResult = await authService.processResetPasswordParams({ returnTo, token });
|
||||
|
||||
if (serviceResult.isErr()) {
|
||||
return Result.err(serviceResult.getError());
|
||||
return Result.err(serviceResult.getError().message);
|
||||
}
|
||||
|
||||
// Transform to ViewData using builder
|
||||
const viewData = ResetPasswordViewDataBuilder.build(serviceResult.unwrap());
|
||||
return Result.ok(viewData);
|
||||
} catch (error) {
|
||||
return Result.err('Failed to execute reset password page query');
|
||||
} catch (error: any) {
|
||||
return Result.err(error.message || 'Failed to execute reset password page query');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,4 +37,4 @@ export class ResetPasswordPageQuery implements PageQuery<ResetPasswordViewData,
|
||||
const query = new ResetPasswordPageQuery();
|
||||
return query.execute(searchParams);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user