mirror of
https://github.com/GNS3/gns3-web-ui.git
synced 2025-01-26 14:19:25 +00:00
Merge pull request #1533 from GNS3/bugfix/1436
Some checks failed
CodeQL / Analyze (javascript) (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled
Build / Node ${{ matrix.node }} (14) (push) Has been cancelled
Build / Node ${{ matrix.node }} (16) (push) Has been cancelled
Build / Node ${{ matrix.node }} (18) (push) Has been cancelled
Some checks failed
CodeQL / Analyze (javascript) (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled
Build / Node ${{ matrix.node }} (14) (push) Has been cancelled
Build / Node ${{ matrix.node }} (16) (push) Has been cancelled
Build / Node ${{ matrix.node }} (18) (push) Has been cancelled
Fix error 404 when editing a project
This commit is contained in:
commit
2e581c4495
@ -21,8 +21,18 @@ export class ReadmeEditorComponent implements OnInit {
|
|||||||
) {}
|
) {}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.projectService.getReadmeFile(this.controller, this.project.project_id).subscribe(file => {
|
this.projectService.getReadmeFile(this.controller, this.project.project_id).subscribe({
|
||||||
if (file) this.markdown = file;
|
next: (file) => {
|
||||||
|
if (file) {
|
||||||
|
this.markdown = file;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
error: (err) => {
|
||||||
|
if (err.status === 404) {
|
||||||
|
// File doesn't exist yet, which is fine
|
||||||
|
this.markdown = '';
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user