Add API to create a new course
This commit is contained in:
parent
feb662d820
commit
09ccd2ec5a
1 changed files with 8 additions and 0 deletions
|
@ -53,4 +53,12 @@ class TitamaApi {
|
|||
throw new NotFoundError('Could not find course \'$id\'.');
|
||||
}
|
||||
|
||||
@ApiMethod(method: 'POST', path: 'course')
|
||||
Course addCourse (Course newCourse) {
|
||||
newCourse.id = _courses.length;
|
||||
_courses.add(newCourse);
|
||||
|
||||
return newCourse;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Reference in a new issue