28 lines
881 B
TypeScript
28 lines
881 B
TypeScript
|
|
|
|
import type { ViewDataBuilder } from '@/lib/contracts/builders/ViewDataBuilder';
|
|
import type { ForgotPasswordPageDTO } from '@/lib/types/generated/ForgotPasswordPageDTO';
|
|
import type { ForgotPasswordViewData } from '@/lib/view-data/ForgotPasswordViewData';
|
|
|
|
export class ForgotPasswordViewDataBuilder {
|
|
public 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,
|
|
};
|
|
}
|
|
}
|
|
|
|
ForgotPasswordViewDataBuilder satisfies ViewDataBuilder<ForgotPasswordPageDTO, ForgotPasswordViewData>;
|