fix: resolve compilation errors in frontend and backend

This commit is contained in:
2026-05-29 17:46:15 +01:00
parent f36497090a
commit f5c2c26fe4
3 changed files with 14 additions and 23 deletions
@@ -36,12 +36,7 @@
let loading = $state(true);
let serviceErrors = $state<Record<string, string>>({});
function validateDuration(val: any, field: string) {
if (typeof val !== 'number' || val < 0) return 'Duration must be a positive number';
return '';
}
function validatePrice(price: any): string {
const numPrice = parseFloat(price);
if (isNaN(numPrice)) {
return 'Price must be a valid number';
@@ -52,7 +47,7 @@
}
const decimalRegex = /^\d+(\.\d{1,2})?$/;
if (!decimalRegex.test(price)) {
if (!decimalRegex.test(price.toString())) {
return 'Price can have up to 2 decimal places';
}