Add API to create a new course

This commit is contained in:
Marcel Kapfer (mmk2410) 2016-06-18 23:41:51 +02:00
parent feb662d820
commit 09ccd2ec5a

View file

@ -53,4 +53,12 @@ class TitamaApi {
throw new NotFoundError('Could not find course \'$id\'.'); 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;
} }
}