Add fileName property to models and update related components for file handling

This commit is contained in:
liosha84
2025-08-09 22:22:02 +03:00
parent ca73cf31df
commit d45fd83593
64 changed files with 1644 additions and 433 deletions
@@ -70,7 +70,7 @@
<mat-divider></mat-divider>
<mat-tab-group>
<mat-tab label="Markdown text | Result">
<textarea class="variable-textarea" [(ngModel)]="markdown"></textarea>
<textarea class="variable-textarea" [(ngModel)]="tutorial.body"></textarea>
<markdown class="variable-binding" [data]="tutorial.body"></markdown>
</mat-tab>
<mat-tab label="Editor">
@@ -70,7 +70,7 @@ const language = 'typescript';
### Blockquote
> Blockquote to the max`;
private id: string | null | undefined;
private fileName: 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.id = params['id'];
console.log(this.id);
this.fileName = params['fileName'];
console.log(this.fileName);
});
this.userApiService.getTutorial(this.id).subscribe(
this.userApiService.getTutorial(this.fileName).subscribe(
data=>{
this.tutorial = data;
}
@@ -148,7 +148,7 @@ const language = 'typescript';
}
updateTutorial(): void {
this.userApiService.update(this.id, this.tutorial)
this.userApiService.update(this.fileName, this.tutorial)
.subscribe(
response => {
console.log(response);