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 55d24b7 commit 3cca2fbCopy full SHA for 3cca2fb
src/Mooc/Courses/application/CreateCourse.ts
@@ -1,5 +1,16 @@
1
+import CourseRepository from '../domain/CourseRepository';
2
+import Course from '../domain/Course';
3
+
4
export default class CreateCourse {
- async run(): Promise<void> {
- return null;
5
+ private repository: CourseRepository;
6
7
+ constructor(repository: CourseRepository) {
8
+ this.repository = repository;
9
+ }
10
11
+ async run(id: string, name: string, duration: string): Promise<void> {
12
+ const course = new Course(id, name, duration);
13
14
+ this.repository.save(course);
15
}
16
0 commit comments