Skip to content

Commit 742dbc3

Browse files
committed
userProfile terminado
1 parent e23ea5a commit 742dbc3

File tree

4 files changed

+11
-12
lines changed

4 files changed

+11
-12
lines changed

backend/gamelink/src/main/resources/application.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ spring.mustache.suffix=.html
1010

1111
spring.datasource.url=jdbc:postgresql://localhost:5432/gamelink
1212
spring.datasource.username=postgres
13-
spring.datasource.password=password
13+
spring.datasource.password=Nekowa10
1414
spring.jpa.hibernate.ddl-auto=create-drop
1515

1616
logging.level.org.springframework.security=DEBUG

backend/gamelink/target/classes/application.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ spring.mustache.suffix=.html
1010

1111
spring.datasource.url=jdbc:postgresql://localhost:5432/gamelink
1212
spring.datasource.username=postgres
13-
spring.datasource.password=password
13+
spring.datasource.password=Nekowa10
1414
spring.jpa.hibernate.ddl-auto=create-drop
1515

1616
logging.level.org.springframework.security=DEBUG

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
<div class="col-md-5 border-right">
1515
<div class="p-3 py-5">
16-
<form *ngIf="loginService.isLogged()">
16+
<form *ngIf="user">
1717
<div class="d-flex justify-content-between align-items-center mb-3">
1818
<h4 class="text-right">Mi perfil: "{{user.nick}}"</h4>
1919
</div>
@@ -62,7 +62,7 @@ <h4 *ngIf="videogame" class="text-right">Mis compras:</h4>
6262
<li>
6363
<div class="row">
6464
<div class="col-md-4">
65-
<img class="img-fluid rounded-3 my-5" [src]="videogameImage()"/>
65+
<img class="img-fluid rounded-3 my-5" [src]="videogameImage(vg)"/>
6666
</div>
6767
<div class="col-md-8 align-self-center">
6868
<p>"{{vg.title}}"</p>

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

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ export class UserProfile {
3030
(videogame: Videogame[]) => videogame = videogame,
3131
(error: any) => console.error(error)
3232
);
33-
// TENGO QUE HACER ALGO DEL TIPO --> THIS.VIDEOGAME = useroService.getVideogames()
3433
}
3534

3635

@@ -50,24 +49,24 @@ export class UserProfile {
5049
let formData = new FormData();
5150
formData.append("imageFile", image);
5251
this.useroService.setUserImage(user, formData).subscribe(
53-
(_: any) => this.afterUploadImage(user),
52+
(_: any) => this.afterUploadImage(),
5453
( error: string) => alert('Error al actualizar o subir la imagen: ' + error)
5554
);
5655
} else {
57-
this.afterUploadImage(user);
56+
this.afterUploadImage();
5857
}
5958
}
6059

61-
private afterUploadImage(user: Usero){
62-
this.router.navigate(['/usero/', user.id]); // NO ESTOY SEGURA DE ESA URL..SEGURAMENTE ESTÉ MAL. REVISARLA
60+
private afterUploadImage(){
61+
this.router.navigate(['/userProfile/']);
6362
}
6463

6564
userImage() {
66-
return this.user?.image? '/api/user/' + this.user?.id + '/image' : '/assets/images/defaultProfilePhoto';
65+
return this.user.image? '/api/users/' + this.user.id + '/image' : '/assets/images/defaultProfilePhoto';
6766
}
6867

69-
videogameImage() {
70-
68+
videogameImage(vg: Videogame) {
69+
return vg.imageVg? '/api/videogames/' + vg.id + '/image' : '/assets/images/defaultProfilePhoto';
7170
}
7271

7372
logOut(){

0 commit comments

Comments
 (0)