fix: revert agent damage — fix svelte-ignore comments, catch var refs, prop mismatches
Lint & Vuln Scan / Go vulnerabilities (push) Successful in 23s
Lint & Vuln Scan / Frontend lint & types (push) Failing after 30s

- Convert HTML comments in script sections to eslint-disable-next-line
- Fix err->_err references in catch blocks across 8 files
- Fix required→_required and onclose→_onclose prop mismatches
- Revert BookingCreateModal.svelte from no-unused-vars agent damage
- Fix broken regex in account page
- Fix .writable (not in Svelte 5 stable) back to +
- Fix NavBar dynamic href links with proper eslint-disable
This commit is contained in:
2026-06-25 16:50:23 +01:00
parent 82e6f75354
commit e0f22e5c5c
25 changed files with 67 additions and 59 deletions
@@ -146,6 +146,8 @@
!customServiceErrors.minimum_age_required
);
function toggleCustomForm(show: boolean) {
showCustomCreateForm = show;
if (show) {
newCustomService = {
name: '',
@@ -324,6 +326,7 @@
: !!(guestName.trim() && guestPhone.trim() && isValidUKPhone(guestPhone))
);
const canProceedStep2 = $derived(selectedServices.length > 0);
const canProceedStep3 = $derived(true); // Overrides are optional
const canProceedStep4 = $derived(!!(selectedDate && selectedTime));
/** Whether the currently selected time slot is out-of-hours */
@@ -484,7 +487,7 @@
(user: { account_role: string }) => !excludedRoles.includes(user.account_role)
);
}
} catch (_err) {
} catch (err) {
toast.error('Failed to load users');
} finally {
loadingUsers = false;
@@ -505,7 +508,7 @@
if (response.ok) {
services = await response.json();
}
} catch (_err) {
} catch (err) {
toast.error('Failed to load services');
} finally {
loadingServices = false;
@@ -579,7 +582,7 @@
workingHours = { ...workingHours, ...whMap };
availableHours = { ...availableHours, ...ahMap };
}
} catch (_err) {
} catch (err) {
toast.error('Failed to load availability');
} finally {
_loadingWorkingHours = false;
@@ -649,7 +652,7 @@
workingHours = { ...workingHours, ...whMap };
availableHours = { ...availableHours, ...ahMap };
}
} catch (_err) {
} catch (err) {
toast.error('Failed to load availability');
} finally {
_loadingWorkingHours = false;
@@ -739,7 +742,7 @@
toast.error(`Failed to reserve slot: ${errorText}`);
return false;
}
} catch (_err) {
} catch (err) {
toast.error('Failed to reserve slot');
return false;
} finally {
@@ -1039,7 +1042,7 @@
const errorText = await res.text();
toast.error(`Failed to create booking: ${errorText}`);
}
} catch (_err) {
} catch (err) {
toast.error('An error occurred while creating booking');
} finally {
submitting = false;
@@ -214,7 +214,7 @@
toast.error('Failed to load booking details: ' + text);
}
} catch (_err) {
console.error('Error fetching booking details:', err);
console.error(..._err);
toast.error('Network error loading booking details');
}
}
@@ -221,7 +221,7 @@
noSlotsToday = true;
} catch (_err) {
console.error('Failed to calculate slot availability', err);
console.error('Failed to calculate slot availability', _err);
noSlotsToday = true;
} finally {
loading = false;
@@ -279,7 +279,7 @@
return false;
}
} catch (_err) {
console.error('Reservation error:', err);
console.error('Reservation error:', _err);
toast.error('Failed to reserve slot');
return false;
} finally {
@@ -297,7 +297,7 @@
);
}
} catch (_err) {
console.error('Failed to fetch users', err);
console.error('Failed to fetch users', _err);
toast.error('Failed to load users');
} finally {
loadingUsers = false;
@@ -815,7 +815,7 @@
bind:value={guestPhone}
bind:error={guestPhoneError}
placeholder="07700 900000"
required={false}
_required={false}
/>
</div>
<p class="rounded-lg bg-yellow-50 p-3 text-sm text-yellow-800">