feat(review): 审稿选章可用——列章端点 + 选章下拉全章可见 + 默认最近章
- 后端新增 GET /projects/{id}/chapters(列真实存在的章 + has_draft/accepted/reviewed_at),TDD 10 测
- gen:api 重生成 TS 客户端(ChapterListItem)
- 选章下拉去掉 hidden(手机/窄屏也可切章);选项以真实章为准 + 大纲结构,
无草稿章置灰(仅当前章例外),覆盖『写过但不在大纲』的章
- 无 ?chapter 时默认落到最近一个有草稿的章,而非硬编码第 1 章
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { serverApiBase } from "./config";
|
||||
import type {
|
||||
ChapterListItem,
|
||||
CharacterListResponse,
|
||||
DraftView,
|
||||
ForeshadowBoardResponse,
|
||||
@@ -150,6 +151,18 @@ export async function fetchOutline(
|
||||
}
|
||||
}
|
||||
|
||||
// 列章(GET .../chapters,裸数组):审稿选章枚举真实存在的章 + 可审/已审标记。
|
||||
// 任何错误降级为空列表(进页不阻塞,回退到大纲/当前章导航)。
|
||||
export async function fetchChapters(
|
||||
projectId: string,
|
||||
): Promise<ChapterListItem[]> {
|
||||
try {
|
||||
return await getJson<ChapterListItem[]>(`/projects/${projectId}/chapters`);
|
||||
} catch {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
// 提示词/模板库列表(GET /templates,全局只读;裸数组)。
|
||||
// 任何错误(含后端未上线)降级为空列表,模板页照常渲染(进页不阻塞)。
|
||||
export async function fetchTemplates(): Promise<TemplateResponse[]> {
|
||||
|
||||
Reference in New Issue
Block a user