Browse Source

Update page validation

pull/1680/head
Hironsan 2 years ago
parent
commit
5e393c5e7c
2 changed files with 8 additions and 2 deletions
  1. 5
      frontend/pages/projects/_id/labels/_label_id/edit.vue
  2. 5
      frontend/pages/projects/_id/labels/add.vue

5
frontend/pages/projects/_id/labels/_label_id/edit.vue

@ -28,7 +28,10 @@ export default Vue.extend({
layout: 'project',
validate({ params, app }) {
validate({ params, query, app }) {
if (!['category', 'span'].includes((query.type as string))) {
return false
}
if (/^\d+$/.test(params.id)) {
return app.$services.project.findById(params.id)
.then((res:ProjectDTO) => {

5
frontend/pages/projects/_id/labels/add.vue

@ -38,7 +38,10 @@ export default Vue.extend({
layout: 'project',
validate({ params, app }) {
validate({ params, query, app }) {
if (!['category', 'span'].includes((query.type as string))) {
return false
}
if (/^\d+$/.test(params.id)) {
return app.$services.project.findById(params.id)
.then((res:ProjectDTO) => {

Loading…
Cancel
Save