You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

25 lines
465 B

package v1
import (
"git.kolaente.de/konrad/Library/models"
"github.com/labstack/echo"
"net/http"
)
// ShowLogs handels viewing logs
func ShowLogs(c echo.Context) error {
// Check if the user is admin
if !models.IsAdmin(c) {
return echo.ErrUnauthorized
}
// Get the logs
logs, err := models.GetAllLogs()
if err != nil {
return c.JSON(http.StatusInternalServerError, models.Message{"Error getting logs."})
}
return c.JSON(http.StatusOK, logs)
}