From 7ac35111081af41bc95d072956dbe165b6397b07 Mon Sep 17 00:00:00 2001
From: Antonin Coquet <ext.sopra.acoquet@grandlyon.com>
Date: Thu, 11 Mar 2021 14:02:42 +0100
Subject: [PATCH] fix: use profileImage attribute for profile picture

---
 src/app/models/user.model.ts           | 1 +
 src/app/profile/profile.component.html | 3 +++
 src/app/profile/profile.component.ts   | 1 +
 3 files changed, 5 insertions(+)

diff --git a/src/app/models/user.model.ts b/src/app/models/user.model.ts
index d4c4b9a58..ed5b7aa02 100644
--- a/src/app/models/user.model.ts
+++ b/src/app/models/user.model.ts
@@ -10,6 +10,7 @@ export class User {
   validationToken: string;
   structuresLink: string[];
   pendingStructuresLink: string[] = [];
+  profileImage: string;
 
   constructor(obj?: any) {
     Object.assign(this, obj);
diff --git a/src/app/profile/profile.component.html b/src/app/profile/profile.component.html
index 54ad68b58..45f184ad1 100644
--- a/src/app/profile/profile.component.html
+++ b/src/app/profile/profile.component.html
@@ -1,6 +1,9 @@
 <div fxLayout="column" class="content-container full-screen" *ngIf="userProfile">
   <div class="profileSection">
     <div class="section-container" fxLayout="row">
+      <ng-container *ngIf="userProfile.profileImage">
+        <img class="cameraProfile" src="userProfile.profileImage">
+      </ng-container>
       <div class="profileInformation" fxLayoutGap="18px" fxLayout="column">
         <div fxLayout="row" fxLayoutAlign="space-between center">
           <p class="profileName">{{ userProfile.name | titlecase }} {{ userProfile.surname | titlecase }}</p>
diff --git a/src/app/profile/profile.component.ts b/src/app/profile/profile.component.ts
index 0b3b1d36c..4c1c5e758 100644
--- a/src/app/profile/profile.component.ts
+++ b/src/app/profile/profile.component.ts
@@ -25,6 +25,7 @@ export class ProfileComponent implements OnInit {
   ngOnInit(): void {
     this.profileService.getProfile().then((profile) => {
       this.userProfile = profile;
+      console.log(this.userProfile.profileImage)
       this.structures = [];
       profile.structuresLink.forEach((structureId) => {
         this.structureService.getStructureWithOwners(structureId, profile).subscribe((s) => {
-- 
GitLab