fix(frontend): Svelte 5 reactivity, each block keys, and path resolution
Add proper keys to #each blocks across 15+ components to fix reordering bugs. Replace new Date() with SvelteDate in reactive contexts. Use $derived for computed values (totalPages). Use resolve() from $app/paths for all internal navigation hrefs. Add ARIA labels and keyboard accessibility to NavBar mobile menu. Remove unused handleRetry from UserPaymentModal. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
@@ -41,11 +41,11 @@
|
||||
let creatingService = $state(false);
|
||||
let serviceErrors = $state<Record<string, string>>({});
|
||||
|
||||
function validatePrice(price: any): string {
|
||||
function validatePrice(price: number | string): string {
|
||||
if (price === null || price === undefined || price === '') {
|
||||
return 'Price is required';
|
||||
}
|
||||
const numPrice = parseFloat(price);
|
||||
const numPrice = parseFloat(typeof price === 'number' ? price.toString() : price);
|
||||
if (isNaN(numPrice)) {
|
||||
return 'Price must be a valid number';
|
||||
}
|
||||
@@ -62,7 +62,7 @@
|
||||
return '';
|
||||
}
|
||||
|
||||
function validateDuration(value: any, field: string): string {
|
||||
function validateDuration(value: number | string, field: string): string {
|
||||
if (value === null || value === undefined || value === '') {
|
||||
return 'Field cannot be empty';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user