fix: 添加删除帖子的 mock handler
- 支持 DELETE /api/posts/:postId 请求 - 从内存存储中正确删除评论 - 修复 mock 模式下删除评论失败的问题 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -1552,7 +1552,7 @@ export const eventHandlers = [
|
||||
try {
|
||||
// 从内存存储中删除评论
|
||||
let deleted = false;
|
||||
for (const [eventId, comments] of eventCommentsStore.entries()) {
|
||||
for (const [eventId, comments] of commentsStore.entries()) {
|
||||
const index = comments.findIndex(c => String(c.id) === String(postId));
|
||||
if (index !== -1) {
|
||||
comments.splice(index, 1);
|
||||
|
||||
Reference in New Issue
Block a user