modified: .env

modified:   bot.db
	modified:   db/db.go
	modified:   go.mod
	modified:   go.sum
	modified:   handlers/dashboard.go
	modified:   main.go
	modified:   services/openrouter.go
	modified:   templates/dashboard.html
This commit is contained in:
2026-03-01 05:39:31 -03:00
parent 7a5f5d86f4
commit 9a341fed76
9 changed files with 270 additions and 46 deletions

View File

@@ -49,6 +49,26 @@ func TestAIHandler(c *gin.Context) {
c.JSON(200, gin.H{"response": response})
}
// Add this to handlers/dashboard.go
func CreateAppointmentHandler(c *gin.Context) {
var body struct {
Phone string `json:"phone"`
Date string `json:"date"`
}
if err := c.BindJSON(&body); err != nil {
c.Status(400)
return
}
// Use the helper function instead of raw SQL here
if err := db.SaveAppointment(body.Phone, body.Date); err != nil {
c.JSON(500, gin.H{"error": err.Error()})
return
}
c.Status(200)
}
// Manage/Delete Appointment
func DeleteAppointmentHandler(c *gin.Context) {
id := c.Param("id")