Refactor tutorial service for public access and enhance authentication handling
This commit is contained in:
@@ -36,7 +36,7 @@ export class TutorialDetailsComponent implements OnInit {
|
||||
}
|
||||
|
||||
getTutorial(id: string): void {
|
||||
this.tutorialService.get(id)
|
||||
/* this.tutorialService.get(id)
|
||||
.subscribe(
|
||||
data => {
|
||||
this.currentTutorial = data;
|
||||
@@ -44,7 +44,7 @@ export class TutorialDetailsComponent implements OnInit {
|
||||
},
|
||||
error => {
|
||||
console.log(error);
|
||||
});
|
||||
});*/
|
||||
}
|
||||
|
||||
updatePublished(status: boolean): void {
|
||||
@@ -56,7 +56,7 @@ export class TutorialDetailsComponent implements OnInit {
|
||||
|
||||
this.message = '';
|
||||
|
||||
this.tutorialService.update(this.currentTutorial.id, data)
|
||||
/* this.tutorialService.update(this.currentTutorial.id, data)
|
||||
.subscribe(
|
||||
response => {
|
||||
this.currentTutorial.published = status;
|
||||
@@ -65,11 +65,11 @@ export class TutorialDetailsComponent implements OnInit {
|
||||
},
|
||||
error => {
|
||||
console.log(error);
|
||||
});
|
||||
});*/
|
||||
}
|
||||
|
||||
updateTutorial(): void {
|
||||
this.message = '';
|
||||
/* this.message = '';
|
||||
|
||||
this.tutorialService.update(this.currentTutorial.id, this.currentTutorial)
|
||||
.subscribe(
|
||||
@@ -79,11 +79,11 @@ export class TutorialDetailsComponent implements OnInit {
|
||||
},
|
||||
error => {
|
||||
console.log(error);
|
||||
});
|
||||
});*/
|
||||
}
|
||||
|
||||
deleteTutorial(): void {
|
||||
this.tutorialService.delete(this.currentTutorial.id)
|
||||
/* this.tutorialService.delete(this.currentTutorial.id)
|
||||
.subscribe(
|
||||
response => {
|
||||
console.log(response);
|
||||
@@ -91,6 +91,6 @@ export class TutorialDetailsComponent implements OnInit {
|
||||
},
|
||||
error => {
|
||||
console.log(error);
|
||||
});
|
||||
});*/
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user