mirror of
https://github.com/GNS3/gns3-web-ui.git
synced 2025-01-12 16:02:45 +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() {
|
||||
this.projectService.getReadmeFile(this.controller, this.project.project_id).subscribe(file => {
|
||||
if (file) this.markdown = file;
|
||||
this.projectService.getReadmeFile(this.controller, this.project.project_id).subscribe({
|
||||
next: (file) => {
|
||||
if (file) {
|
||||
this.markdown = file;
|
||||
}
|
||||
},
|
||||
error: (err) => {
|
||||
if (err.status === 404) {
|
||||
// File doesn't exist yet, which is fine
|
||||
this.markdown = '';
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user