From e8f53f428266824c35152068b30bf7d796535bbb Mon Sep 17 00:00:00 2001 From: Stephen Adamson Date: Sun, 9 Nov 2025 01:49:21 +0000 Subject: [PATCH] linting and bugfixing --- backend/handlers/services/services.go | 12 +- frontend/eslint.config.js | 11 +- frontend/src/routes/admin/+page.svelte | 163 ++++++++++++++----------- frontend/src/routes/book/+page.svelte | 116 +++++------------- frontend/src/routes/login/+page.svelte | 17 ++- 5 files changed, 149 insertions(+), 170 deletions(-) diff --git a/backend/handlers/services/services.go b/backend/handlers/services/services.go index e6d27df..917d4f9 100644 --- a/backend/handlers/services/services.go +++ b/backend/handlers/services/services.go @@ -109,13 +109,13 @@ func CreateServiceHandler(w http.ResponseWriter, r *http.Request) { // Insert new service query := ` INSERT INTO services ( - name, description, price, duration_minutes, + name, description, price, duration_minutes, patch_test_duration_hours, minimum_age_required, created_by - ) + ) VALUES ($1, $2, $3, $4, $5, $6, $7) - RETURNING + RETURNING id, name, description, price, duration_minutes, is_active, - patch_test_duration_hours, minimum_age_required, created_at, + patch_test_duration_hours, minimum_age_required, created_at, created_by ` @@ -200,7 +200,7 @@ func DeleteServiceHandler(w http.ResponseWriter, r *http.Request) { func ServicesHandler(w http.ResponseWriter, r *http.Request) { // Query all active services query := ` - SELECT id, name, description, price, duration_minutes, + SELECT id, name, description, price, duration_minutes, patch_test_duration_hours, minimum_age_required FROM services WHERE is_active = TRUE @@ -261,7 +261,7 @@ func ServicesHandler(w http.ResponseWriter, r *http.Request) { func AllServicesHandler(w http.ResponseWriter, r *http.Request) { // Query all services including inactive ones query := ` - SELECT id, name, description, price, duration_minutes, is_active, + SELECT id, name, description, price, duration_minutes, is_active, patch_test_duration_hours, minimum_age_required, created_at, created_by FROM services ORDER BY is_active DESC, name diff --git a/frontend/eslint.config.js b/frontend/eslint.config.js index 2c49fa6..fe7def0 100644 --- a/frontend/eslint.config.js +++ b/frontend/eslint.config.js @@ -24,7 +24,16 @@ export default defineConfig( rules: { // typescript-eslint strongly recommend that you do not use the no-undef lint rule on TypeScript projects. // see: https://typescript-eslint.io/troubleshooting/faqs/eslint/#i-get-errors-from-the-no-undef-rule-about-global-variables-not-being-defined-even-though-there-are-no-typescript-errors - 'no-undef': 'off' + 'no-undef': 'off', + // Allow underscore prefix for unused variables + '@typescript-eslint/no-unused-vars': [ + 'error', + { + argsIgnorePattern: '^_', + varsIgnorePattern: '^_', + caughtErrorsIgnorePattern: '^_' + } + ] } }, { diff --git a/frontend/src/routes/admin/+page.svelte b/frontend/src/routes/admin/+page.svelte index b4dcd28..47d95bf 100644 --- a/frontend/src/routes/admin/+page.svelte +++ b/frontend/src/routes/admin/+page.svelte @@ -1,6 +1,8 @@