mirror of
https://github.com/GNS3/gns3-web-ui.git
synced 2024-12-27 00:21:03 +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() {
|
||||
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