fix(teacher): 独立刷新老师目录以缩短配置更新延迟
This commit is contained in:
@@ -32,10 +32,11 @@ export async function handleCodingTeacherRoutes(
|
||||
const role = projectTopics?.[2] === 'friend' ? 'friend' : undefined;
|
||||
const config = url.pathname === '/api/coding/teacher/config' || url.pathname === '/api/coding/friend/config';
|
||||
const catalog = url.pathname === '/api/coding/teacher/teachers';
|
||||
const catalogRevision = url.pathname === '/api/coding/teacher/teachers/revision';
|
||||
const draft = url.pathname === '/api/coding/teacher-preview';
|
||||
const pending = url.pathname === '/api/coding/teacher-preview/pending-link';
|
||||
if (!legacy && !conversation && !source && !preview && !projectTopics && !checkIn && !config && !catalog && !draft && !pending) return false;
|
||||
if ((config || catalog || draft || pending) && req.method !== 'GET') {
|
||||
if (!legacy && !conversation && !source && !preview && !projectTopics && !checkIn && !config && !catalog && !catalogRevision && !draft && !pending) return false;
|
||||
if ((config || catalog || catalogRevision || draft || pending) && req.method !== 'GET') {
|
||||
sendJson(res, 405, { error: '不支持此操作。' });
|
||||
return true;
|
||||
}
|
||||
@@ -82,6 +83,10 @@ export async function handleCodingTeacherRoutes(
|
||||
));
|
||||
return true;
|
||||
}
|
||||
if (catalogRevision) {
|
||||
sendJson(res, 200, await service.catalogRevision());
|
||||
return true;
|
||||
}
|
||||
if (catalog) {
|
||||
sendJson(res, 200, await service.catalog());
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user