feat: productionize learning engine and classroom
This commit is contained in:
1 parent
2d04197f3f
commit
ba35adfbfa
124 files changed
+9071
-796
No files matched your search
@@ -15,6 +15,7 @@ import {
|
||||
isCourseGenerationRunning,
|
||||
} from '@/lib/course-framework/runner';
|
||||
import { requireOpsAccess } from '@/lib/server/ops-access';
|
||||
import { proxyLargeCourseControlToEngine } from '@/lib/makelore-runtime/ops-engine-control';
|
||||
|
||||
const log = createLogger('Course Cancel API');
|
||||
|
||||
@@ -22,7 +23,7 @@ export async function POST(
|
||||
request: NextRequest,
|
||||
{ params }: { params: Promise<{ courseId: string }> },
|
||||
) {
|
||||
const denied = requireOpsAccess(request);
|
||||
const denied = await requireOpsAccess(request);
|
||||
if (denied) return denied;
|
||||
|
||||
try {
|
||||
@@ -34,6 +35,12 @@ export async function POST(
|
||||
if (!record) {
|
||||
return apiError(API_ERROR_CODES.INVALID_REQUEST, 404, `Course not found: ${courseId}`);
|
||||
}
|
||||
const proxied = await proxyLargeCourseControlToEngine({
|
||||
request,
|
||||
course: record,
|
||||
action: 'cancel',
|
||||
});
|
||||
if (proxied) return proxied;
|
||||
if (!isCourseGenerationRunning(courseId)) {
|
||||
return apiError(API_ERROR_CODES.INVALID_REQUEST, 409, 'Course generation is not running');
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user