Better skeleton use, live services in booking
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user