Better skeleton use, live services in booking

This commit is contained in:
2025-10-18 21:39:57 +01:00
parent fad47df642
commit 68cf27541a
6 changed files with 408 additions and 212 deletions
+3 -1
View File
@@ -28,6 +28,7 @@ type Service struct {
}
type ServiceResponse struct {
ID string `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
Price float64 `json:"price"`
@@ -207,7 +208,7 @@ func DeleteServiceHandler(w http.ResponseWriter, r *http.Request) {
func ServicesHandler(w http.ResponseWriter, r *http.Request) {
// Query all active services
query := `
SELECT 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
@@ -227,6 +228,7 @@ func ServicesHandler(w http.ResponseWriter, r *http.Request) {
var service ServiceResponse
err := rows.Scan(
&service.ID,
&service.Name,
&service.Description,
&service.Price,