Refactor tutorial and user models to replace fileName with id, update related components and services for consistency
This commit is contained in:
+5
-5
@@ -70,7 +70,7 @@ const language = 'typescript';
|
||||
|
||||
### Blockquote
|
||||
> Blockquote to the max`;
|
||||
private fileName: string | null | undefined;
|
||||
private id: string | null | undefined;
|
||||
|
||||
constructor(private userApiService: UserApiService,
|
||||
private route: ActivatedRoute,
|
||||
@@ -81,11 +81,11 @@ const language = 'typescript';
|
||||
this.route.queryParams
|
||||
.subscribe(params => {
|
||||
console.log(params);
|
||||
this.fileName = params['fileName'];
|
||||
console.log(this.fileName);
|
||||
this.id = params['id'];
|
||||
console.log(this.id);
|
||||
});
|
||||
|
||||
this.userApiService.getTutorial(this.fileName).subscribe(
|
||||
this.userApiService.getTutorial(this.id).subscribe(
|
||||
data=>{
|
||||
this.tutorial = data;
|
||||
}
|
||||
@@ -148,7 +148,7 @@ const language = 'typescript';
|
||||
}
|
||||
|
||||
updateTutorial(): void {
|
||||
this.userApiService.update(this.fileName, this.tutorial)
|
||||
this.userApiService.update(this.id, this.tutorial)
|
||||
.subscribe(
|
||||
response => {
|
||||
console.log(response);
|
||||
|
||||
Reference in New Issue
Block a user