Skip to content
This repository has been archived by the owner on Feb 23, 2022. It is now read-only.

Commit

Permalink
Merge pull request #241 from multinet-app/invalid_workspace_redirect
Browse files Browse the repository at this point in the history
Add simple redirect on invalid workspaces
  • Loading branch information
jjnesbitt committed Jan 8, 2020
2 parents 31da05e + 606066f commit f782897
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions client/src/views/WorkspaceDetail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,21 @@ export default Vue.extend({
methods: {
async update(this: any) {
// Get lists of node and edge tables.
const nodeTables = await api.tables(this.workspace, { type: 'node' });
const edgeTables = await api.tables(this.workspace, { type: 'edge' });
let nodeTables;
let edgeTables;
try {
nodeTables = await api.tables(this.workspace, { type: 'node' });
edgeTables = await api.tables(this.workspace, { type: 'edge' });
} catch (err) {
if (err.status === 404 && err.statusText === 'Workspace Not Found') {
this.$router.replace({name: 'home'});
} else {
throw err;
}
return;
}
this.tables = nodeTables.concat(edgeTables);
this.nodeTables = nodeTables;
Expand Down

0 comments on commit f782897

Please sign in to comment.