Skip to content

Commit 08b9369

Browse files
committed
fixed casting in user service
1 parent 3652517 commit 08b9369

File tree

4 files changed

+25
-33
lines changed

4 files changed

+25
-33
lines changed
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<header></header>
2-
<!--navBar></navBar-->
2+
<navBar></navBar>
33

44
<home></home>
55

6-
<!--router-outlet></router-outlet-->
6+
<router-outlet></router-outlet>
77
<footer></footer>

frontend/src/app/components/user/userProfile.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export class UserProfile {
2121
const id = activatedRoute.snapshot.params['id'];
2222
if (id) {
2323
useroService.getUser(id).subscribe(
24-
(user: Usero) => user = user,
24+
(user) => this.user = user as Usero,
2525
(error: any) => console.error(error)
2626
);
2727
}

frontend/src/app/services/usero.service.ts

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -17,40 +17,40 @@ export class UseroService {
1717

1818

1919
/*------------------GET METHODS------------------*/
20-
getUsers(): Observable<Usero[]> {
20+
getUsers(){
2121
return this.http.get(BASE_URL).pipe(
22-
//catchError((error: any) => this.handleError(error))
23-
) as Observable<Usero[]>;
22+
catchError((error: any) => this.handleError(error))
23+
);
2424
}
2525

26-
getUser(id: number | string): Observable<Usero> {
26+
getUser(id: number | string) {
2727
return this.http.get(BASE_URL + id).pipe(
28-
//catchError((error: any) => this.handleError(error))
29-
) as Observable<Usero>;
28+
catchError((error: any) => this.handleError(error))
29+
);
3030
}
3131

32-
getVideogames(user: Usero): Observable<Videogame[]> {
32+
getVideogames(user: Usero) {
3333
return this.http.get(BASE_URL + '/purchases' + user.id).pipe(
34-
//catchError((error: any) => this.handleError(error))
35-
) as Observable<Videogame[]>;
34+
catchError((error: any) => this.handleError(error))
35+
);
3636
}
3737

38-
getUserReadNews(id: number | string): Observable<News[]> {
38+
getUserReadNews(id: number | string) {
3939
return this.http.get(BASE_URL + '/purchases' + id).pipe(
40-
//catchError((error: any) => this.handleError(error))
41-
) as Observable<News[]>;
40+
catchError((error: any) => this.handleError(error))
41+
);
4242
}
4343

44-
getRecommended(id: number | string): Observable<Videogame[]> {
44+
getRecommended(id: number | string) {
4545
return this.http.get(BASE_URL + id + '/recommendations' ).pipe(
46-
//catchError((error: any) => this.handleError(error))
47-
) as Observable<Videogame[]>;
46+
catchError((error: any) => this.handleError(error))
47+
);
4848
}
4949

50-
getMe(): Observable<Usero> {
50+
getMe() {
5151
return this.http.get(BASE_URL + '/me').pipe(
52-
//catchError((error: any) => this.handleError(error))
53-
) as Observable<Usero>;
52+
catchError((error: any) => this.handleError(error))
53+
);
5454
}
5555

5656
/*------------------CREATE METHODS------------------*/

frontend/src/styles.css

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -147,9 +147,9 @@
147147
}
148148

149149

150-
/*end*
150+
/*fin*
151151
152-
/**(there is also for background color)*/
152+
/**modification juan (there is also for background color)*/
153153

154154

155155
.col-lg-4.mb-5{
@@ -166,9 +166,9 @@
166166
max-height: 100% !important;
167167
}
168168

169-
/**end*/
169+
/**fin*/
170170

171-
/**CSS User Profile*/
171+
/**Css perfil de usuario*/
172172

173173
body {
174174
background: rgb(99, 39, 120)
@@ -11617,22 +11617,14 @@ form{
1161711617

1161811618
/*Para el gráfico circular*/
1161911619
* {
11620-
<<<<<<< HEAD
1162111620
box-sizing: border-box;
11622-
=======
11623-
box-sizing: border-box;
11624-
>>>>>>> origin/JuanFase3
1162511621
}
1162611622
.grafico {
1162711623
height: 400px;
1162811624
margin: 1rem auto;
1162911625
position: relative;
1163011626
width: 400px;
11631-
<<<<<<< HEAD
1163211627
}
11633-
=======
11634-
}
11635-
>>>>>>> origin/JuanFase3
1163611628
.recorte {
1163711629
border-radius: 50%;
1163811630
clip: rect(0px, 400px, 400px, 200px);

0 commit comments

Comments
 (0)