diff --git a/docs/api-change.md b/docs/api-change.md index 1fac31a7a9..7bab3af1b3 100644 --- a/docs/api-change.md +++ b/docs/api-change.md @@ -4,6 +4,7 @@ Breaking changes are indicated by the :warning: icon. ## Unreleased +- :warning: `followingCount` and `followersCount` in `users/show` will be `null` (instead of 0) if these values are unavailable. - :warning: `admin/search/index-all` is removed since posts are now indexed automatically. - New optional parameters are added to `notes/search` endpoint: - `sinceDate` diff --git a/packages/backend/src/models/repositories/user.ts b/packages/backend/src/models/repositories/user.ts index d71cf4ac7f..7c6105d2f2 100644 --- a/packages/backend/src/models/repositories/user.ts +++ b/packages/backend/src/models/repositories/user.ts @@ -513,8 +513,8 @@ export const UserRepository = db.getRepository(User).extend({ location: profile!.location, birthday: profile!.birthday, fields: profile!.fields, - followersCount: followersCount || 0, - followingCount: followingCount || 0, + followersCount: followersCount ?? null, + followingCount: followingCount ?? null, notesCount: user.notesCount, pinnedNoteIds: pins.map((pin) => pin.noteId), pinnedNotes: Notes.packMany( diff --git a/packages/client/src/pages/user/home.vue b/packages/client/src/pages/user/home.vue index f4ece80aa9..13846e42d4 100644 --- a/packages/client/src/pages/user/home.vue +++ b/packages/client/src/pages/user/home.vue @@ -311,6 +311,7 @@ {{ i18n.ts.notes }} {{ i18n.ts.following }}