File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
packages/express/src/client-requests Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -116,6 +116,11 @@ const elodoc = {
116116 language : 'javascript' ,
117117} ;
118118
119+ /**
120+ * Inserts a design document into a course database.
121+ * @param courseID - The ID of the course database.
122+ * @param doc
123+ */
119124function insertDesignDoc (
120125 courseID : string ,
121126 doc : {
@@ -168,6 +173,10 @@ type CourseConfig = CreateCourse['data'];
168173async function createCourse ( cfg : CourseConfig ) : Promise < any > {
169174 cfg . courseID = await CourseLookup . add ( cfg . name ) ;
170175
176+ if ( ! cfg . courseID ) {
177+ throw new Error ( 'Course ID not found' ) ;
178+ }
179+
171180 const courseDBName : string = getCourseDBName ( cfg . courseID ) ;
172181 const dbCreation = await CouchDB . db . create ( courseDBName ) ;
173182
You can’t perform that action at this time.
0 commit comments