Skip to content
This repository was archived by the owner on Oct 14, 2019. It is now read-only.

Commit d0be38d

Browse files
author
Your Name
committed
Angular and Firebase App
1 parent 2b9c667 commit d0be38d

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

src/app/lesson-detail/lesson-detail.component.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,5 +64,16 @@ export class LessonDetailComponent implements OnInit {
6464
}
6565

6666

67+
requestLessonDeletion() {
68+
this.lessonsService.requestLessonDeletion(this.lesson.$key, this.lesson.courseId)
69+
.subscribe(
70+
() => alert('Lesson deleted'),
71+
console.error
72+
);
73+
74+
}
75+
76+
77+
6778

6879
}

src/app/shared/model/lessons.service.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,15 @@ export class LessonsService {
125125
}
126126

127127

128+
requestLessonDeletion(lessonId:string, courseId:string) {
129+
this.sdkDb.child('queue/tasks').push({lessonId, courseId})
130+
.then(
131+
() => alert('lesson deletion requested !')
132+
);
133+
}
134+
135+
136+
128137
}
129138

130139

0 commit comments

Comments
 (0)