Skip to content
This repository has been archived by the owner on Jan 15, 2025. It is now read-only.

Commit

Permalink
update reputation order
Browse files Browse the repository at this point in the history
  • Loading branch information
feruzm committed Feb 26, 2024
1 parent 48cafa5 commit 993b452
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/common/api/hive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -286,19 +286,20 @@ export const getAccounts = (usernames: string[]): Promise<FullAccount[]> => {
);
};

export const getAccount = (username: string): Promise<FullAccount> =>
getAccounts([username]).then((resp) => resp[0]);
export const getAccount = async (username: string): Promise<FullAccount> => {
let aa = await getAccounts([username]).then((resp) => resp[0]);
let rp = await getAccountReputations(username, 1);
return { ...aa, ...rp[0] };
};

export const getAccountFull = (username: string): Promise<FullAccount> =>
getAccount(username).then(async (account) => {
let follow_stats: AccountFollowStats | undefined;
let reps: Reputations[] | [{}];
try {
follow_stats = await getFollowCount(username);
reps = await getAccountReputations(username, 1);
} catch (e) {}

return { ...account, ...reps[0], follow_stats };
return { ...account, follow_stats };
});

export const getFollowCount = (username: string): Promise<AccountFollowStats> =>
Expand Down

0 comments on commit 993b452

Please sign in to comment.