[backend/api] Add like and renote count to NoteBase schema

This commit is contained in:
Laura Hausmann 2024-04-20 01:15:54 +02:00
parent 156735f40b
commit 3bb3ac785e
No known key found for this signature in database
GPG key ID: D044E84C5BE01605
2 changed files with 5 additions and 1 deletions

View file

@ -72,7 +72,9 @@ public class NoteRenderer(UserRenderer userRenderer, DatabaseContext db, EmojiSe
Visibility = RenderVisibility(note.Visibility),
User = noteUser,
Attachments = attachments.ToList(),
Reactions = reactions.ToList()
Reactions = reactions.ToList(),
Likes = note.LikeCount,
Renotes = note.RenoteCount
};
}

View file

@ -35,6 +35,8 @@ public class NoteBase
[J("text")] public required string? Text { get; set; }
[J("cw")] public required string? Cw { get; set; }
[J("visibility")] public required string Visibility { get; set; }
[J("likes")] public required int Likes { get; set; }
[J("renotes")] public required int Renotes { get; set; }
[J("user")] public required UserResponse User { get; set; }
[J("attachments")] public required List<NoteAttachment> Attachments { get; set; }
[J("reactions")] public required List<NoteReactionSchema> Reactions { get; set; }