Browse Source

fix: handle 404 in shared base/view

pull/7405/head
Pranav C 11 months ago
parent
commit
aba85d27bf
  1. 7
      packages/nc-gui/store/bases.ts

7
packages/nc-gui/store/bases.ts

@ -92,6 +92,7 @@ export const useBases = defineStore('basesStore', () => {
const loadProjects = async (page: 'recent' | 'shared' | 'starred' | 'workspace' = 'recent') => {
// if shared base then get the shared base and create a list
if (route.value.params.typeOrId === 'base' && route.value.params.baseId) {
try {
const { base_id } = await $api.public.sharedBaseGet(route.value.params.baseId as string)
const base: BaseType = await $api.base.read(base_id)
@ -111,6 +112,12 @@ export const useBases = defineStore('basesStore', () => {
})
return
} catch (e: any) {
if (e?.response?.status === 404) {
return router.push('/error/404')
}
throw e
}
}
const activeWorkspace = workspaceStore.activeWorkspace

Loading…
Cancel
Save