Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hotfix: User infos in trip details now load correctly #97

Merged
merged 1 commit into from
Jun 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions UniRide/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ yarn-error.log
testem.log
/typings
environment.ts

# System files
.DS_Store
Thumbs.db
2 changes: 1 addition & 1 deletion UniRide/src/app/core/services/user/user.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export class UserService implements UserInterface {
'Content-Type': 'application/json',
});

return this.http.get(`${this.backUrl}/admin/infos/${id}`, { headers })
return this.http.get(`${this.backUrl}/user/infos/${id}`, { headers })
}

getInfosUserById(userId: number): Observable<any> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<p-card header="Conducteur">
<div *ngIf="user" class="flex align-items-start">
<p-avatar *ngIf="!user.profile_picture" icon="pi pi-user" class="mr-2" size="xlarge" (click)="showDialog()"/>
<p-avatar *ngIf="user.profile_picture" [image]="user.profile_picture" class="mr-2" size="xlarge"/>
<p-avatar *ngIf="user.profile_picture" [image]="user.profile_picture" class="mr-2" size="xlarge" (click)="showDialog()"/>
<div class="flex-grow-1 align-self-start">
<p class="md:text-2xl sm:xl">{{ user.firstname }} {{ user.lastname }}</p>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ export class UserInfoSummaryComponent implements OnInit {
id: data.id,
firstname: data.firstname,
lastname: data.lastname,
description: data.description
description: data.description,
profile_picture: data.profile_picture
}
},
error: (err) => console.error(err)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div class="font-bold text-2xl flex">
<p-avatar *ngIf="user.profile_picture" [image]="user.profile_picture" class="mr-2" (click)="showDialog()"
<p-avatar *ngIf="user.profile_picture" [image]="user.profile_picture" class="mr-2"
size="xlarge" />
<p-avatar *ngIf="!user.profile_picture" icon="pi pi-user" class="mr-2" size="xlarge" (click)="showDialog()" />
<p-avatar *ngIf="!user.profile_picture" icon="pi pi-user" class="mr-2" size="xlarge"/>
<p>{{ user.firstname }} {{ user.lastname }}</p>
</div>
<!-- <p>Genre: {{ getGender() }}</p> -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ export class UserInfoComponent implements OnInit {
this.userService.getUserInfoDetails(this.config.data.userid).subscribe({
next: (data: any) => {
this.user = {
id: data.id,
firstname: data.firstname,
lastname: data.lastname,
gender: data.gender,
description: data.description,
phone_number: data.phone_number,
profile_picture: data.profile_picture??""
id: data.user_information.id,
firstname: data.user_information.firstname,
lastname: data.user_information.lastname,
gender: data.user_information.gender,
description: data.user_information.description,
phone_number: data.user_information.phone_number,
profile_picture: data.user_information.profile_picture??""
}
},
error: (error: any) => {
Expand Down
Loading