38 lines
1.2 KiB
TypeScript
38 lines
1.2 KiB
TypeScript
/**
|
|
* Forgot Password View Data Builder
|
|
*
|
|
* Transforms ForgotPasswordPageDTO into ViewData for the forgot password template.
|
|
* Deterministic, side-effect free, no business logic.
|
|
*/
|
|
|
|
import { ForgotPasswordPageDTO } from '@/lib/services/auth/types/ForgotPasswordPageDTO';
|
|
import { ForgotPasswordViewData } from '../../view-data/ForgotPasswordViewData';
|
|
import { ViewData } from '@/lib/contracts/view-data/ViewData';
|
|
import { error } from 'console';
|
|
|
|
import { ViewDataBuilder } from "../../contracts/builders/ViewDataBuilder";
|
|
|
|
export class ForgotPasswordViewDataBuilder implements ViewDataBuilder<any, any> {
|
|
build(input: any): any {
|
|
return ForgotPasswordViewDataBuilder.build(input);
|
|
}
|
|
|
|
static build(
|
|
static build(apiDto: ForgotPasswordPageDTO): ForgotPasswordViewData {
|
|
return {
|
|
returnTo: apiDto.returnTo,
|
|
showSuccess: false,
|
|
formState: {
|
|
fields: {
|
|
email: { value: '', error: undefined, touched: false, validating: false },
|
|
},
|
|
isValid: true,
|
|
isSubmitting: false,
|
|
submitError: undefined,
|
|
submitCount: 0,
|
|
},
|
|
isSubmitting: false,
|
|
submitError: undefined,
|
|
};
|
|
}
|
|
} |