Refactor tutorial and user models to replace fileName with id, update related components and services for consistency

This commit is contained in:
liosha84
2025-08-10 11:27:22 +03:00
parent d45fd83593
commit c840adb229
23 changed files with 112 additions and 456 deletions
@@ -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);