mirror of
https://github.com/sstent/garminsync-go.git
synced 2026-01-25 16:42:45 +00:00
working build - no ui
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user