Truncated the post's body to prevent them from being too long

This commit is contained in:
2025-05-01 23:49:17 +08:00
parent f7e926ad24
commit 24f1a3a9e9
5 changed files with 83 additions and 2 deletions

View File

@ -38,6 +38,7 @@ public class PostController(AppDatabase db, PostService ps, RelationshipService
.Skip(offset)
.Take(take)
.ToListAsync();
posts = PostService.TruncatePostContent(posts);
Response.Headers["X-Total"] = totalCount.ToString();
@ -101,6 +102,7 @@ public class PostController(AppDatabase db, PostService ps, RelationshipService
.Skip(offset)
.Take(take)
.ToListAsync();
posts = PostService.TruncatePostContent(posts);
Response.Headers["X-Total"] = totalCount.ToString();