Browse Source

Update label page validation

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

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

@ -56,6 +56,7 @@ import FormDelete from '@/components/label/FormDelete.vue'
import FormUpload from '@/components/label/FormUpload.vue'
import LabelList from '@/components/label/LabelList.vue'
import { LabelDTO } from '~/services/application/label/labelData'
import { ProjectDTO } from '~/services/application/project/projectData'
export default Vue.extend({
layout: 'project',
@ -183,8 +184,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.canDefineLabel
})
}
return false
}
})
</script>

Loading…
Cancel
Save