working build - no ui

This commit is contained in:
2025-08-25 16:34:45 -07:00
parent 8fb9028cf8
commit b370173873
6 changed files with 51 additions and 36 deletions

View File

@@ -13,12 +13,12 @@ import (
type WebHandler struct {
db *database.SQLiteDB
syncer *sync.Syncer
syncer *sync.SyncService
garmin *garmin.Client
templates map[string]interface{} // Placeholder for template handling
}
func NewWebHandler(db *database.SQLiteDB, syncer *sync.Syncer, garmin *garmin.Client) *WebHandler {
func NewWebHandler(db *database.SQLiteDB, syncer *sync.SyncService, garmin *garmin.Client) *WebHandler {
return &WebHandler{
db: db,
syncer: syncer,
@@ -27,6 +27,11 @@ func NewWebHandler(db *database.SQLiteDB, syncer *sync.Syncer, garmin *garmin.Cl
}
}
func (h *WebHandler) LoadTemplates(templateDir string) error {
// For now, just return nil - templates will be handled later
return nil
}
func (h *WebHandler) RegisterRoutes(router *gin.Engine) {
router.GET("/", h.Index)
router.GET("/activities", h.ActivityList)
@@ -79,7 +84,7 @@ func (h *WebHandler) ActivityDetail(c *gin.Context) {
}
func (h *WebHandler) Sync(c *gin.Context) {
err := h.syncer.FullSync(context.Background())
err := h.syncer.Sync(context.Background())
if err != nil {
c.AbortWithStatus(http.StatusInternalServerError)
return