Commit bef3ad4
fix: Wiki API 紧急 bug 修复
修复两个 P0 级别的 Wiki API bug:
1. 修复 PATCH /wiki/page/{pageName} 总是更新 "unnamed" 页面的问题
- 原因: 当 form.Title 为空时,UserTitleToWebPath("", "") 会返回默认值 "unnamed"
- 解决: 在调用 UserTitleToWebPath 前先检查 form.Title 是否为空,为空则直接使用路径参数中的页面名
2. 修复 GET /wiki/revisions/{pageName} 返回对象而非数组的问题
- 原因: 使用了 convert.ToWikiCommitList() 将数组包装成了 {commits: [...], count: N} 对象
- 解决: 直接返回 []*api.WikiCommit 数组,保持 RESTful 规范
- 总数仍通过 X-Total-Count HTTP header 提供
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>1 parent 77b8059 commit bef3ad4
1 file changed
+12
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
137 | 137 | | |
138 | 138 | | |
139 | 139 | | |
140 | | - | |
141 | 140 | | |
142 | | - | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
143 | 144 | | |
| 145 | + | |
| 146 | + | |
144 | 147 | | |
145 | 148 | | |
146 | 149 | | |
| |||
445 | 448 | | |
446 | 449 | | |
447 | 450 | | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
448 | 457 | | |
449 | | - | |
| 458 | + | |
450 | 459 | | |
451 | 460 | | |
452 | 461 | | |
| |||
0 commit comments