@@ -48,16 +48,16 @@ export class HttpBackendInterceptor implements HttpInterceptor {
48
48
49
49
var data = new Date ( ) ;
50
50
51
- users . push ( new User ( { Id :
1 , Name :
'Pikachu' , Email :
'[email protected] ' , Document :
'02343767327' , Birthdate :
new Date ( '1991-04-28T12:00:00' ) , Country :
'Brasil ' , Profile :
'Administrator' , Active :
true } ) ) ;
52
- users . push ( new User ( { Id :
2 , Name :
'Charmander' , Email :
'[email protected] ' , Document :
'02343767327' , Birthdate :
new Date ( '1991-04-28T12:00:00' ) , Country :
'Brasil ' , Profile :
'Administrator ' , Active :
true } ) ) ;
53
- users . push ( new User ( { Id :
3 , Name :
'Squirtle' , Email :
'[email protected] ' , Document :
'02343767327' , Birthdate :
new Date ( '1991-04-28T12:00:00' ) , Country :
'Brasil ' , Profile :
'Administrator' , Active :
true } ) ) ;
54
- users . push ( new User ( { Id :
4 , Name :
'Bulbasaur' , Email :
'[email protected] ' , Document :
'02343767327' , Birthdate :
new Date ( '1991-04-28T12:00:00' ) , Country :
'Brasil ' , Profile :
'Administrator' , Active :
true } ) ) ;
55
- users . push ( new User ( { Id :
5 , Name :
'Mew' , Email :
'[email protected] ' , Document :
'02343767327' , Birthdate :
new Date ( '1991-04-28T12:00:00' ) , Country :
'Brasil ' , Profile :
'Administrator' , Active :
true } ) ) ;
56
- users . push ( new User ( { Id :
6 , Name :
'Chansey' , Email :
'[email protected] ' , Document :
'02343767327' , Birthdate :
new Date ( '1991-04-28T12:00:00' ) , Country :
'Brasil ' , Profile :
'Administrator' , Active :
true } ) ) ;
57
- users . push ( new User ( { Id :
7 , Name :
'Blaziken' , Email :
'[email protected] ' , Document :
'02343767327' , Birthdate :
new Date ( '1991-04-28T12:00:00' ) , Country :
'Brasil ' , Profile :
'Administrator ' , Active :
true } ) ) ;
58
- users . push ( new User ( { Id :
8 , Name :
'Feraligart' , Email :
'[email protected] ' , Document :
'02343767327' , Birthdate :
new Date ( '1991-04-28T12:00:00' ) , Country :
'Brasil ' , Profile :
'Administrator' , Active :
true } ) ) ;
59
- users . push ( new User ( { Id :
9 , Name :
'Chikorita' , Email :
'[email protected] ' , Document :
'02343767327' , Birthdate :
new Date ( '1991-04-28T12:00:00' ) , Country :
'Brasil ' , Profile :
'Administrator ' , Active :
true } ) ) ;
60
- users . push ( new User ( { Id :
10 , Name :
'Torchic' , Email :
'[email protected] ' , Document :
'02343767327' , Birthdate :
new Date ( '1991-04-28T12:00:00' ) , Country :
'Brasil ' , Profile :
'Administrator ' , Active :
true } ) ) ;
51
+ users . push ( new User ( { Id :
1 , Name :
'Pikachu' , Email :
'[email protected] ' , Document :
'02343767327' , Birthdate :
new Date ( '1991-04-28T12:00:00' ) , Country :
'Kanto ' , Profile :
'Administrator' , Active :
true } ) ) ;
52
+ users . push ( new User ( { Id :
2 , Name :
'Charmander' , Email :
'[email protected] ' , Document :
'02343767327' , Birthdate :
new Date ( '1991-04-28T12:00:00' ) , Country :
'Kanto ' , Profile :
'Regular ' , Active :
false } ) ) ;
53
+ users . push ( new User ( { Id :
3 , Name :
'Squirtle' , Email :
'[email protected] ' , Document :
'02343767327' , Birthdate :
new Date ( '1991-04-28T12:00:00' ) , Country :
'Kanto ' , Profile :
'Administrator' , Active :
true } ) ) ;
54
+ users . push ( new User ( { Id :
4 , Name :
'Bulbasaur' , Email :
'[email protected] ' , Document :
'02343767327' , Birthdate :
new Date ( '1991-04-28T12:00:00' ) , Country :
'Kanto ' , Profile :
'Administrator' , Active :
true } ) ) ;
55
+ users . push ( new User ( { Id :
5 , Name :
'Mew' , Email :
'[email protected] ' , Document :
'02343767327' , Birthdate :
new Date ( '1991-04-28T12:00:00' ) , Country :
'Kanto ' , Profile :
'Administrator' , Active :
false } ) ) ;
56
+ users . push ( new User ( { Id :
6 , Name :
'Chansey' , Email :
'[email protected] ' , Document :
'02343767327' , Birthdate :
new Date ( '1991-04-28T12:00:00' ) , Country :
'Kanto ' , Profile :
'Administrator' , Active :
true } ) ) ;
57
+ users . push ( new User ( { Id :
7 , Name :
'Blaziken' , Email :
'[email protected] ' , Document :
'02343767327' , Birthdate :
new Date ( '1991-04-28T12:00:00' ) , Country :
'Hoenn ' , Profile :
'Regular ' , Active :
true } ) ) ;
58
+ users . push ( new User ( { Id :
8 , Name :
'Feraligart' , Email :
'[email protected] ' , Document :
'02343767327' , Birthdate :
new Date ( '1991-04-28T12:00:00' ) , Country :
'Johto ' , Profile :
'Administrator' , Active :
true } ) ) ;
59
+ users . push ( new User ( { Id :
9 , Name :
'Chikorita' , Email :
'[email protected] ' , Document :
'02343767327' , Birthdate :
new Date ( '1991-04-28T12:00:00' ) , Country :
'Johto ' , Profile :
'Regular ' , Active :
false } ) ) ;
60
+ users . push ( new User ( { Id :
10 , Name :
'Torchic' , Email :
'[email protected] ' , Document :
'02343767327' , Birthdate :
new Date ( '1991-04-28T12:00:00' ) , Country :
'Hoenn ' , Profile :
'Regular ' , Active :
true } ) ) ;
61
61
62
62
let pagination : Pagination < User > = {
63
63
Items : users ,
@@ -70,27 +70,30 @@ export class HttpBackendInterceptor implements HttpInterceptor {
70
70
}
71
71
72
72
if ( req . url . includes ( 'users/' ) && req . method === 'GET' ) {
73
- var user : User = {
74
- Id : 1 ,
75
- Name : 'Gabriel Lucena ' ,
76
- Email : 'gnllucena @gmail.com' ,
77
- Document : '023.437.673-27 ' ,
73
+ var user = new User ( {
74
+ Id : 666 ,
75
+ Name : 'Mewtwo ' ,
76
+ Email : 'mewtwo @gmail.com' ,
77
+ Document : '02343767327 ' ,
78
78
Birthdate : new Date ( '1991-04-28T12:00:00' ) ,
79
- Country : 'Brasil ' ,
79
+ Country : 'Kanto ' ,
80
80
Profile : 'Administrator' ,
81
81
Active : true
82
- }
82
+ } )
83
83
84
84
return of ( new HttpResponse ( { status : 200 , body : user } ) ) ;
85
85
}
86
86
87
87
if ( req . url . includes ( 'countries' ) && req . method === 'GET' ) {
88
88
let countries : Country [ ] = [ ] ;
89
89
90
- countries . push ( new Country ( { Id : 1 , Name : 'Brazil' } ) ) ;
91
- countries . push ( new Country ( { Id : 1 , Name : 'United States of America' } ) ) ;
92
- countries . push ( new Country ( { Id : 1 , Name : 'Thailand' } ) ) ;
93
- countries . push ( new Country ( { Id : 1 , Name : 'Greece' } ) ) ;
90
+ countries . push ( new Country ( { Id : 1 , Name : 'Kanto' } ) ) ;
91
+ countries . push ( new Country ( { Id : 2 , Name : 'Johto' } ) ) ;
92
+ countries . push ( new Country ( { Id : 3 , Name : 'Hoenn' } ) ) ;
93
+ countries . push ( new Country ( { Id : 4 , Name : 'Sinnoh' } ) ) ;
94
+ countries . push ( new Country ( { Id : 5 , Name : 'Unova' } ) ) ;
95
+ countries . push ( new Country ( { Id : 6 , Name : 'Kalos' } ) ) ;
96
+ countries . push ( new Country ( { Id : 7 , Name : 'Alola' } ) ) ;
94
97
95
98
return of ( new HttpResponse ( { status : 200 , body : countries } ) ) ;
96
99
}
0 commit comments