fix (backend): return null (instead of 0) if following/followers count is unavailable
This commit is contained in:
parent
517022f9b2
commit
75f277f461
3 changed files with 5 additions and 2 deletions
|
@ -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`
|
||||
|
|
|
@ -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(
|
||||
|
|
|
@ -311,6 +311,7 @@
|
|||
<span>{{ i18n.ts.notes }}</span>
|
||||
</MkA>
|
||||
<MkA
|
||||
v-if="user.followingCount != null"
|
||||
v-click-anime
|
||||
:to="userPage(user, 'following')"
|
||||
:class="{ active: page === 'following' }"
|
||||
|
@ -319,6 +320,7 @@
|
|||
<span>{{ i18n.ts.following }}</span>
|
||||
</MkA>
|
||||
<MkA
|
||||
v-if="user.followersCount != null"
|
||||
v-click-anime
|
||||
:to="userPage(user, 'followers')"
|
||||
:class="{ active: page === 'followers' }"
|
||||
|
|
Loading…
Reference in a new issue