Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated account response #263

Merged
merged 1 commit into from
Jan 16, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/http/api/accounts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@ interface Account {
*/
url: string;
/**
* URL pointing to the avatar of the account
* URL of the avatar of the account
*/
avatarUrl: string;
/**
* URL pointing to the banner image of the account
* URL of the banner image of the account
*/
bannerImageUrl: string | null;
/**
Expand All @@ -68,7 +68,7 @@ interface Account {
/**
* Number of posts created by the account
*/
postsCount: number;
postCount: number;
/**
* Number of liked posts by the account
*/
Expand Down Expand Up @@ -111,7 +111,7 @@ function getHandle(host?: string, username?: string) {
*
* @param db Database instance
*/
async function getPostsCount(db: KvStore) {
async function getPostCount(db: KvStore) {
const posts = await db.get<string[]>(['outbox']);

return posts?.length || 0;
Expand Down Expand Up @@ -192,7 +192,7 @@ export async function handleGetAccount(ctx: AppContext) {
accountData.preferredUsername,
),
bio: sanitizeHtml(accountData.summary),
url: accountData.id,
url: accountData.url,
avatarUrl: accountData.icon,
/**
* At the moment we don't support banner images for Ghost accounts
Expand All @@ -202,7 +202,7 @@ export async function handleGetAccount(ctx: AppContext) {
* At the moment we don't support custom fields for Ghost accounts
*/
customFields: {},
postsCount: await getPostsCount(db),
postCount: await getPostCount(db),
likedCount: await getLikedCount(db),
followingCount: await getFollowingCount(db),
followerCount: await getFollowerCount(db),
Expand Down
Loading