mirror of
https://github.com/GNS3/gns3-web-ui.git
synced 2024-12-28 08:48:50 +00:00
Fix error 404 when editing a project
This commit is contained in:
parent
180c65351b
commit
cddce63e2b
@ -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…
Reference in New Issue
Block a user