Merge Yuxi teacher support with classroom discussions
This commit is contained in:
@@ -4,6 +4,7 @@ import type {
|
||||
TeacherAvailability,
|
||||
TeacherCheckInInput,
|
||||
TeacherCheckInResult,
|
||||
TeacherCatalog,
|
||||
TeacherDefinition,
|
||||
TeacherDiscussionAction,
|
||||
TeacherSend,
|
||||
@@ -17,6 +18,7 @@ export function teacherTopicsPath(projectId: string, sourceId: string, role?: Co
|
||||
: `/api/coding/projects/${encodeURIComponent(projectId)}/conversations/${encodeURIComponent(sourceId)}/teacher-topics`;
|
||||
}
|
||||
export const teacherApi = {
|
||||
catalog: () => hostApiFetch<TeacherCatalog>('/api/coding/teacher/teachers'),
|
||||
checkIn: (projectId: string, input: TeacherCheckInInput) =>
|
||||
hostApiFetch<TeacherCheckInResult>(`/api/coding/projects/${encodeURIComponent(projectId)}/teacher-check-in`, {
|
||||
method: 'POST',
|
||||
@@ -31,10 +33,10 @@ export const teacherApi = {
|
||||
'/api/coding/teacher-preview?draftRevision=' + draftRevision
|
||||
),
|
||||
list: (base: string) => hostApiFetch<TeacherTopicList>(base),
|
||||
create: (base: string, draftRevision?: number, sampleContext?: string) =>
|
||||
create: (base: string, draftRevision?: number, sampleContext?: string, teacherVersion?: number) =>
|
||||
hostApiFetch<TeacherTopic>(base, {
|
||||
method: 'POST',
|
||||
body: JSON.stringify({ draftRevision, sampleContext }),
|
||||
body: JSON.stringify({ draftRevision, sampleContext, teacherVersion }),
|
||||
}),
|
||||
read: (base: string, id: string, select = true) =>
|
||||
hostApiFetch<TeacherTopic>(base + '/' + encodeURIComponent(id) + (select ? '' : '?select=false')),
|
||||
|
||||
Reference in New Issue
Block a user