We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 359e893 commit b6fdf96Copy full SHA for b6fdf96
src/apps/mooc_backend/controllers/CreateCourseController.ts
@@ -3,11 +3,15 @@ import CreateCourse from '../../../Mooc/Courses/application/CreateCourse';
3
import httpStatus from 'http-status';
4
5
export default class CreateCourseController {
6
- constructor(private createUser: CreateCourse) {}
+ constructor(private createCourse: CreateCourse) {}
7
8
async create(req: Request, res: Response) {
9
+ const id: string = req.params.id;
10
+ const name: string = req.body.name;
11
+ const duration: string = req.body.duration;
12
+
13
try {
- await this.createUser.run();
14
+ await this.createCourse.run(id, name, duration);
15
} catch (e) {
16
res.status(500).json(e);
17
}
0 commit comments