Skip to content

Commit 79e7fa7

Browse files
committed
get it from contact
1 parent ba6638e commit 79e7fa7

File tree

2 files changed

+23
-14
lines changed

2 files changed

+23
-14
lines changed

services/static-webserver/client/source/class/osparc/data/model/User.js

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,20 @@ qx.Class.define("osparc.data.model.User", {
6262
phoneNumber: userData["phone"] || null,
6363
label: userData["userName"] || description,
6464
description,
65-
institution: userData["institution"] || null,
66-
address: userData["address"] || null,
67-
city: userData["city"] || null,
68-
state: userData["state"] || null,
69-
country: userData["country"] || null,
70-
postalCode: userData["postal_code"] || null,
7165
});
7266

67+
if (userData["contact"]) {
68+
const contact = userData["contact"]
69+
this.set({
70+
institution: contact["institution"] || null,
71+
address: contact["address"] || null,
72+
city: contact["city"] || null,
73+
state: contact["state"] || null,
74+
country: contact["country"] || null,
75+
postalCode: contact["postalCode"] || null,
76+
});
77+
}
78+
7379
// create the thumbnail after setting email and username
7480
this.set({
7581
thumbnail: this.createThumbnail(),

services/static-webserver/client/source/class/osparc/desktop/account/ProfilePage.js

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -107,14 +107,17 @@ qx.Class.define("osparc.desktop.account.ProfilePage", {
107107
"phone": data["phone"] || "-",
108108
"expirationDate": data["expirationDate"] || null,
109109
});
110-
this.__personalInfoModel.set({
111-
"institution": data["institution"] || "",
112-
"address": data["address"] || "",
113-
"city": data["city"] || "",
114-
"state": data["state"] || "",
115-
"country": data["country"] || "",
116-
"postalCode": data["postal_code"] || "",
117-
});
110+
if (data["contact"]) {
111+
const contact = data["contact"];
112+
this.__personalInfoModel.set({
113+
"institution": contact["institution"] || "",
114+
"address": contact["address"] || "",
115+
"city": contact["city"] || "",
116+
"state": contact["state"] || "",
117+
"country": contact["country"] || "",
118+
"postalCode": contact["postalCode"] || "",
119+
});
120+
}
118121
}
119122
this.__updateProfileBtn.setEnabled(false);
120123

0 commit comments

Comments
 (0)