Skip to content
This repository was archived by the owner on Nov 28, 2025. It is now read-only.

Commit 6a417f8

Browse files
committed
♻️ refactoring
1 parent 468fdcd commit 6a417f8

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

src/app/modules/authentication/pages/forgot-password/forgot-password.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ <h2 class="mt-6 text-3xl font-semibold text-slate-900">Mot de passe oublié?</h2
2222
</div>
2323

2424
<div class="flex items-center justify-end">
25-
<cosna-button-primary type="submit" class="justify-center" [loading$]="(loading$)">
25+
<cosna-button-primary type="submit" [loading$]="(loading$)">
2626
Envoyer le lien de réinitialisation
2727
</cosna-button-primary>
2828
</div>

src/app/modules/authentication/pages/forgot-password/forgot-password.component.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { Component, OnInit } from '@angular/core';
22
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
33
import { Store } from '@ngrx/store';
44
import { Observable } from 'rxjs';
5+
56
import { forgotPasswordAction } from '../../store/auth.actions';
67
import { selectError, selectLoading, selectMessage } from '../../store/auth.selectors';
78

@@ -12,8 +13,11 @@ export class ForgotPasswordComponent implements OnInit {
1213
public form: FormGroup = this.formBuilder.group({
1314
email: ['', [Validators.required, Validators.email]],
1415
});
16+
1517
public error$: Observable<string | null> = this.store.select(selectError);
18+
1619
public message$: Observable<string | null> = this.store.select(selectMessage);
20+
1721
public loading$: Observable<boolean> = this.store.select(selectLoading);
1822

1923
constructor(private formBuilder: FormBuilder, private store: Store) { }
@@ -23,6 +27,8 @@ export class ForgotPasswordComponent implements OnInit {
2327
public submit() {
2428
if (this.form.valid) {
2529
this.store.dispatch(forgotPasswordAction(this.form.getRawValue()));
30+
31+
this.form.reset();
2632
}
2733
}
2834

src/app/modules/authentication/pages/login/login.component.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ export class LoginComponent implements OnInit {
1414
email: ['', [Validators.required, Validators.email]],
1515
password: ['', Validators.required],
1616
});
17+
1718
public error$: Observable<string | null> = this.store.select(selectError);
19+
1820
public loading$: Observable<boolean> = this.store.select(selectLoading);
1921

2022
constructor(private formBuilder: FormBuilder, private store: Store) {}

0 commit comments

Comments
 (0)