Remove parameter we don't care about.

This commit is contained in:
Daniel Krol 2022-04-09 19:18:27 -04:00
parent a75c7b22a1
commit 2e84e0ff40
2 changed files with 3 additions and 8 deletions

View file

@ -274,7 +274,7 @@ export class ApproveComponent implements OnInit {
return of(description); return of(description);
} }
// Otherwise, we hit get-users-stateless to fetch profiles. // Otherwise, we hit get-users-stateless to fetch profiles.
return this.backendApi.GetUsersStateless(publicKeys, true).pipe((map(res => { return this.backendApi.GetUsersStateless(publicKeys).pipe((map(res => {
const userList = res.UserList; const userList = res.UserList;
// If the response has no users, return the description as is. // If the response has no users, return the description as is.
if (userList.length === 0) { if (userList.length === 0) {

View file

@ -46,18 +46,13 @@ export class BackendAPIService {
return this.post(path, {...body, ...{JWT: jwt}}); return this.post(path, {...body, ...{JWT: jwt}});
} }
// When SkipForLeaderboard is true, this endpoint only returns ProfileEntryResponse, IsGraylisted, IsBlacklisted,
// IsAdmin, and IsSuperAdmin for each user.
// When SkipForLeaderboard is false, we also fetch the user's balance, profiles this user follows, hodlings, and
// UserMetadata. Oftentimes, this information is not needed and excluding it significantly improves performance.
GetUsersStateless( GetUsersStateless(
publicKeys: string[], SkipForLeaderboard: boolean = false, publicKeys: string[]
): Observable<{ UserList: User[]}> { ): Observable<{ UserList: User[]}> {
return this.httpClient.post<any>( return this.httpClient.post<any>(
`${this.endpoint}/get-users-stateless`, `${this.endpoint}/get-users-stateless`,
{ {
PublicKeysBase58Check: publicKeys, PublicKeysBase58Check: publicKeys,
SkipForLeaderboard,
}, },
); );
} }
@ -66,7 +61,7 @@ export class BackendAPIService {
publicKeys: string[] publicKeys: string[]
): Observable<{[key: string]: string}> { ): Observable<{[key: string]: string}> {
const usernames: {[key: string]: any} = {}; const usernames: {[key: string]: any} = {};
const req = this.GetUsersStateless(publicKeys, true); const req = this.GetUsersStateless(publicKeys);
if (publicKeys.length > 0) { if (publicKeys.length > 0) {
return req.pipe( return req.pipe(
map( res => { map( res => {