Browse Source

fix(nc-gui): redirect to 404 page if invalid viewid is requested

pull/3669/head
braks 2 years ago committed by Raju Udava
parent
commit
9bac78e0de
  1. 5
      packages/nc-gui/pages/[projectType]/form/[viewId].vue
  2. 4
      packages/nc-gui/pages/error/404.vue

5
packages/nc-gui/pages/[projectType]/form/[viewId].vue

@ -4,8 +4,10 @@ import {
IsPublicInj,
MetaInj,
ReloadViewDataHookInj,
createError,
createEventHook,
definePageMeta,
navigateTo,
provide,
reactive,
ref,
@ -37,6 +39,9 @@ if (!notFound.value) {
provide(IsFormInj, ref(true))
useProvideSmartsheetStore(sharedView, meta, true)
} else {
navigateTo('/error/404')
throw createError({ statusCode: 404, statusMessage: 'Page Not Found' })
}
const form = reactive({

4
packages/nc-gui/pages/error/404.vue

@ -8,8 +8,8 @@ definePageMeta({
</script>
<template>
<div class="w-full h-[300px] flex justify-center items-center text-4xl">
<div class="text-gray-400 flex gap-2 items-center">
<div class="bg-primary bg-opacity-5 w-full h-full flex flex-col justify-center items-center text-4xl gap-12">
<div class="text-gray-400 flex gap-4 items-center">
<MdiWarning />
Page Not Found
</div>

Loading…
Cancel
Save