Skip to content

Commit

Permalink
fix: remove idParamRegex in favor of simpler id number checking
Browse files Browse the repository at this point in the history
Signed-off-by: Alexander Trost <[email protected]>
  • Loading branch information
galexrt committed Dec 25, 2024
1 parent 16c6a6c commit 2a60ae7
Show file tree
Hide file tree
Showing 18 changed files with 2,172 additions and 2,328 deletions.
2 changes: 1 addition & 1 deletion app/pages/citizens/[id].vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ definePageMeta({
if (typeof route.params.id !== 'string') {
return false;
}
return idParamRegex.test(route.params.id as string);
return !!(route.params.id && !isNaN(Number(route.params.id))) && Number(route.params.id) > -1;
},
});
Expand Down
2 changes: 1 addition & 1 deletion app/pages/documents/[id]/edit.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ definePageMeta({
if (typeof route.params.id !== 'string') {
return false;
}
return idParamRegex.test(route.params.id as string);
return !!(route.params.id && !isNaN(Number(route.params.id))) && Number(route.params.id) > -1;
},
});
Expand Down
2 changes: 1 addition & 1 deletion app/pages/documents/[id]/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ definePageMeta({
if (typeof route.params.id !== 'string') {
return false;
}
return idParamRegex.test(route.params.id as string);
return !!(route.params.id && !isNaN(Number(route.params.id))) && Number(route.params.id) > -1;
},
});
Expand Down
2 changes: 1 addition & 1 deletion app/pages/documents/templates/[id].vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ definePageMeta({
if (typeof route.params.id !== 'string') {
return false;
}
return idParamRegex.test(route.params.id as string);
return !!(route.params.id && !isNaN(Number(route.params.id))) && Number(route.params.id) > -1;
},
});
Expand Down
2 changes: 1 addition & 1 deletion app/pages/documents/templates/edit/[id].vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ definePageMeta({
if (typeof route.params.id !== 'string') {
return false;
}
return idParamRegex.test(route.params.id as string);
return !!(route.params.id && !isNaN(Number(route.params.id))) && Number(route.params.id) > -1;
},
});
Expand Down
2 changes: 1 addition & 1 deletion app/pages/jobs/colleagues/[id].vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ definePageMeta({
if (typeof route.params.id !== 'string') {
return false;
}
return idParamRegex.test(route.params.id as string);
return !!(route.params.id && !isNaN(Number(route.params.id))) && Number(route.params.id) > -1;
},
});
Expand Down
2 changes: 1 addition & 1 deletion app/pages/jobs/colleagues/[id]/activity.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ definePageMeta({
if (typeof route.params.id !== 'string') {
return false;
}
return idParamRegex.test(route.params.id as string);
return !!(route.params.id && !isNaN(Number(route.params.id))) && Number(route.params.id) > -1;
},
});
Expand Down
2 changes: 1 addition & 1 deletion app/pages/jobs/colleagues/[id]/conduct.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ definePageMeta({
if (typeof route.params.id !== 'string') {
return false;
}
return idParamRegex.test(route.params.id as string);
return !!(route.params.id && !isNaN(Number(route.params.id))) && Number(route.params.id) > -1;
},
});
Expand Down
2 changes: 1 addition & 1 deletion app/pages/jobs/colleagues/[id]/info.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ definePageMeta({
if (typeof route.params.id !== 'string') {
return false;
}
return idParamRegex.test(route.params.id as string);
return !!(route.params.id && !isNaN(Number(route.params.id))) && Number(route.params.id) > -1;
},
});
Expand Down
2 changes: 1 addition & 1 deletion app/pages/jobs/colleagues/[id]/qualifications.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ definePageMeta({
if (typeof route.params.id !== 'string') {
return false;
}
return idParamRegex.test(route.params.id as string);
return !!(route.params.id && !isNaN(Number(route.params.id))) && Number(route.params.id) > -1;
},
});
Expand Down
2 changes: 1 addition & 1 deletion app/pages/jobs/colleagues/[id]/timeclock.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ definePageMeta({
if (typeof route.params.id !== 'string') {
return false;
}
return idParamRegex.test(route.params.id as string);
return !!(route.params.id && !isNaN(Number(route.params.id))) && Number(route.params.id) > -1;
},
});
Expand Down
2 changes: 1 addition & 1 deletion app/pages/qualifications/[id]/edit.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ definePageMeta({
if (typeof route.params.id !== 'string') {
return false;
}
return idParamRegex.test(route.params.id as string);
return !!(route.params.id && !isNaN(Number(route.params.id))) && Number(route.params.id) > -1;
},
});
Expand Down
2 changes: 1 addition & 1 deletion app/pages/qualifications/[id]/exam/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ definePageMeta({
if (typeof route.params.id !== 'string') {
return false;
}
return idParamRegex.test(route.params.id as string);
return !!(route.params.id && !isNaN(Number(route.params.id))) && Number(route.params.id) > -1;
},
});
Expand Down
2 changes: 1 addition & 1 deletion app/pages/qualifications/[id]/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ definePageMeta({
if (typeof route.params.id !== 'string') {
return false;
}
return idParamRegex.test(route.params.id as string);
return !!(route.params.id && !isNaN(Number(route.params.id))) && Number(route.params.id) > -1;
},
});
Expand Down
2 changes: 1 addition & 1 deletion app/pages/wiki/[job]/[id]/[[slug]].vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ definePageMeta({
if (typeof route.params.id !== 'string') {
return false;
}
return idParamRegex.test(route.params.id as string);
return !!(route.params.id && !isNaN(Number(route.params.id))) && Number(route.params.id) > -1;
},
});
Expand Down
3 changes: 0 additions & 3 deletions app/utils/routes.ts

This file was deleted.

19 changes: 9 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,21 @@
},
"dependencies": {
"@galexrt/nuxt-update": "1.0.1",
"@git-diff-view/vue": "0.0.22",
"@iconify-json/flagpack": "1.2.2",
"@iconify-json/mdi": "1.2.2",
"@iconify-json/simple-icons": "1.2.16",
"@iconify-json/simple-icons": "1.2.17",
"@nuxt/content": "2.13.4",
"@nuxt/fonts": "0.10.3",
"@nuxt/ui-pro": "1.6.0",
"@nuxtjs/robots": "5.0.1",
"@nuxtjs/robots": "5.1.0",
"@pinia/nuxt": "0.9.0",
"@protobuf-ts/grpcweb-transport": "2.9.4",
"@unovis/ts": "1.5.0",
"@unovis/vue": "1.5.0",
"@vue-leaflet/vue-leaflet": "0.10.1",
"@zxcvbn-ts/core": "3.0.4",
"browser-headers": "0.4.1",
"consola": "3.3.0",
"consola": "3.3.1",
"date-fns": "4.1.0",
"emoji-blast": "0.10.2",
"google-protobuf": "3.21.4",
Expand Down Expand Up @@ -94,17 +93,17 @@
"@types/splitpanes": "2.2.6",
"@types/uuid": "10.0.0",
"@types/zxcvbn": "4.4.5",
"@vueuse/core": "12.1.0",
"@vueuse/nuxt": "12.1.0",
"@vueuse/router": "12.1.0",
"@vueuse/core": "12.2.0",
"@vueuse/nuxt": "12.2.0",
"@vueuse/router": "12.2.0",
"autoprefixer": "10.4.20",
"cssnano": "7.0.6",
"eslint": "9.17.0",
"eslint-config-prettier": "9.1.0",
"eslint-plugin-prettier": "5.2.1",
"eslint-plugin-vue": "9.32.0",
"nuxi": "3.17.1",
"nuxt": "3.14.1592",
"nuxi": "3.17.2",
"nuxt": "3.15.0",
"nuxt-tiptap-editor": "2.1.4",
"nuxt-typed-router": "3.7.2",
"pinia-plugin-persistedstate": "4.2.0",
Expand All @@ -126,7 +125,7 @@
"typescript": "5.7.2",
"vue": "3.5.13",
"vue-i18n-routing": "1.2.0",
"vue-tsc": "2.1.10"
"vue-tsc": "2.2.0"
},
"resolutions": {
"@nuxt/ui": "2.19.1"
Expand Down
Loading

0 comments on commit 2a60ae7

Please sign in to comment.