Browse Source

Update relation page validation

pull/1400/head
Hironsan 3 years ago
parent
commit
d273ca9f97
1 changed files with 9 additions and 2 deletions
  1. 11
      frontend/pages/projects/_id/links/index.vue

11
frontend/pages/projects/_id/links/index.vue

@ -46,6 +46,7 @@ import FormCreate from '@/components/links/FormCreate.vue'
import FormDelete from '@/components/links/FormDelete.vue' import FormDelete from '@/components/links/FormDelete.vue'
import LinksList from '~/components/links/LinksList.vue' import LinksList from '~/components/links/LinksList.vue'
import { LinkTypeDTO } from '~/services/application/links/linkData' import { LinkTypeDTO } from '~/services/application/links/linkData'
import { ProjectDTO } from '~/services/application/project/projectData'
export default Vue.extend({ export default Vue.extend({
layout: 'project', layout: 'project',
@ -142,8 +143,14 @@ export default Vue.extend({
} }
}, },
validate({ params }) {
return /^\d+$/.test(params.id)
validate({ params, app }) {
if (/^\d+$/.test(params.id)) {
return app.$services.project.findById(params.id)
.then((res:ProjectDTO) => {
return res.canDefineRelation
})
}
return false
} }
}) })
</script> </script>

Loading…
Cancel
Save