chore: git cache cleanup
This commit is contained in:
25
backend/internal/api/handlers/update_handler.go
Normal file
25
backend/internal/api/handlers/update_handler.go
Normal file
@@ -0,0 +1,25 @@
|
||||
package handlers
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/Wikid82/charon/backend/internal/services"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
type UpdateHandler struct {
|
||||
service *services.UpdateService
|
||||
}
|
||||
|
||||
func NewUpdateHandler(service *services.UpdateService) *UpdateHandler {
|
||||
return &UpdateHandler{service: service}
|
||||
}
|
||||
|
||||
func (h *UpdateHandler) Check(c *gin.Context) {
|
||||
info, err := h.service.CheckForUpdates()
|
||||
if err != nil {
|
||||
c.JSON(http.StatusInternalServerError, gin.H{"error": "Failed to check for updates"})
|
||||
return
|
||||
}
|
||||
c.JSON(http.StatusOK, info)
|
||||
}
|
||||
Reference in New Issue
Block a user