Skip to content

Commit d76c3d0

Browse files
committed
add awaits back to methods after refactoring
1 parent b005dd0 commit d76c3d0

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/app/mydata/services/profile.service.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -104,22 +104,22 @@ export class ProfileService {
104104

105105
async checkProfileExists() {
106106
await this.updateToken();
107-
return firstValueFrom(this.http.get(this.apiUrl + '/userprofile/', this.httpOptions));
107+
return await firstValueFrom(this.http.get(this.apiUrl + '/userprofile/', this.httpOptions));
108108
}
109109

110110
async createProfile() {
111111
await this.updateToken();
112-
return firstValueFrom(this.http.post(this.apiUrl + '/userprofile/', null, this.httpOptions));
112+
return await firstValueFrom(this.http.post(this.apiUrl + '/userprofile/', null, this.httpOptions));
113113
}
114114

115115
async deleteProfile() {
116116
await this.updateToken();
117-
return firstValueFrom(this.http.delete(this.apiUrl + '/userprofile/', this.httpOptions));
117+
return await firstValueFrom(this.http.delete(this.apiUrl + '/userprofile/', this.httpOptions));
118118
}
119119

120120
async hideProfile() {
121121
await this.updateToken();
122-
return firstValueFrom(this.http.get(this.apiUrl + '/settings/hideprofile', this.httpOptions));
122+
return await firstValueFrom(this.http.get(this.apiUrl + '/settings/hideprofile', this.httpOptions));
123123
}
124124

125125
/*
@@ -128,12 +128,12 @@ export class ProfileService {
128128
*/
129129
async deleteAccount() {
130130
await this.updateToken({ bypassOrcidCheck: true });
131-
return firstValueFrom(this.http.delete(this.apiUrl + '/accountdelete/', this.httpOptions));
131+
return await firstValueFrom(this.http.delete(this.apiUrl + '/accountdelete/', this.httpOptions));
132132
}
133133

134134
async getOrcidData() {
135135
await this.updateToken();
136-
return firstValueFrom(this.http.get(this.apiUrl + '/orcid/', this.httpOptions));
136+
return await firstValueFrom(this.http.get(this.apiUrl + '/orcid/', this.httpOptions));
137137
}
138138

139139
async getProfileData(): Promise<any> {
@@ -155,19 +155,19 @@ export class ProfileService {
155155
async patchObjects(items) {
156156
await this.updateToken();
157157
let body = { groups: [], items: items };
158-
return firstValueFrom(this.http.patch(this.apiUrl + '/profiledata/', body, this.httpOptions));
158+
return await firstValueFrom(this.http.patch(this.apiUrl + '/profiledata/', body, this.httpOptions));
159159
}
160160

161161
async patchProfileDataSingleGroup(group) {
162162
await this.updateToken();
163163
let body = { groups: group, items: [] };
164-
return firstValueFrom(this.http.patch(this.apiUrl + '/profiledata/', body, this.httpOptions));
164+
return await firstValueFrom(this.http.patch(this.apiUrl + '/profiledata/', body, this.httpOptions));
165165
}
166166

167167
async patchProfileDataSingleItem(item) {
168168
await this.updateToken();
169169
let body = { groups: [], items: item };
170-
return firstValueFrom(this.http.patch(this.apiUrl + '/profiledata/', body, this.httpOptions));
170+
return await firstValueFrom(this.http.patch(this.apiUrl + '/profiledata/', body, this.httpOptions));
171171
}
172172

173173
/*
@@ -177,6 +177,6 @@ export class ProfileService {
177177
*/
178178
async accountlink() {
179179
await this.updateToken({ bypassOrcidCheck: true });
180-
return firstValueFrom(this.http.get(this.apiUrl + '/accountlink/', this.httpOptions));
180+
return await firstValueFrom(this.http.get(this.apiUrl + '/accountlink/', this.httpOptions));
181181
}
182182
}

0 commit comments

Comments
 (0)