Skip to content

Commit f2d81e5

Browse files
committed
🎨 move validations rules on shared module and refactor views and interface
1 parent a468198 commit f2d81e5

File tree

4 files changed

+11
-31
lines changed

4 files changed

+11
-31
lines changed

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ import { FormBuilder, FormGroup, Validators } from '@angular/forms';
33
import { Store } from '@ngrx/store';
44
import { map, Observable } from 'rxjs';
55

6+
import { PasswordRules } from '@app/shared/rules/password.rules';
67
import {
78
selectError,
89
selectLoading,
910
selectMessage,
1011
selectResetPasswordToken,
1112
} from '../../store/auth.selectors';
1213
import { resetPasswordAction } from '../../store/auth.actions';
13-
import { PasswordRules } from '../../rules/password.rules';
1414

1515
@Component({
1616
templateUrl: './reset-password.component.html',
@@ -29,11 +29,8 @@ export class ResetPasswordComponent {
2929
);
3030

3131
public error$: Observable<string | null> = this.store.select(selectError);
32-
3332
public message$: Observable<string | null> = this.store.select(selectMessage);
34-
3533
public loading$: Observable<boolean> = this.store.select(selectLoading);
36-
3734
public token$: Observable<string | null> = this.store.select(
3835
selectResetPasswordToken
3936
);

src/app/modules/authentication/rules/password.rules.ts

Lines changed: 0 additions & 19 deletions
This file was deleted.

src/app/shared/interfaces/response.interface.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ export type IFilterParams = {
1010

1111
export interface Pagination {
1212
total: number;
13-
per_page: number;
14-
current_page: number;
15-
next_page: string | null;
16-
prev_page: string | null;
17-
first_page: string | null;
18-
last_page: string | null;
13+
perPage: number;
14+
currentPage: number;
15+
nextPage: string | null;
16+
prevPage: string | null;
17+
firstPage: string | null;
18+
lastPage: string | null;
1919
from: number;
2020
to: number;
21-
total_pages: number;
21+
totalPages: number;
2222
}

src/app/shared/interfaces/values.interface.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1+
import { Pagination } from './response.interface';
2+
13
/**
24
* This pagination Object is the default structure of
35
* a Custom Laravel Eloquent Pagination Response
46
*
57
* @see https://laravel.com/docs/eloquent-resources#pagination
68
*/
7-
export const pagination = {
9+
export const pagination: Pagination = {
810
total: 0,
911
perPage: 0,
1012
currentPage: 0,

0 commit comments

Comments
 (0)