2017-10-10 16:23:52 +00:00
|
|
|
package v1
|
|
|
|
|
|
|
|
import (
|
2017-11-07 15:35:10 +00:00
|
|
|
"git.mowie.cc/konrad/Library/models"
|
2017-10-10 16:23:52 +00:00
|
|
|
"github.com/labstack/echo"
|
|
|
|
"net/http"
|
|
|
|
)
|
|
|
|
|
2017-11-08 09:55:17 +00:00
|
|
|
// PublishersList is the handler to list publishers
|
2017-10-10 16:23:52 +00:00
|
|
|
func PublishersList(c echo.Context) error {
|
|
|
|
|
2017-10-10 19:58:55 +00:00
|
|
|
list, err := models.ListPublishers("")
|
2017-10-10 16:23:52 +00:00
|
|
|
|
2017-11-07 15:35:10 +00:00
|
|
|
if err != nil {
|
2017-10-10 16:23:52 +00:00
|
|
|
return c.JSON(http.StatusInternalServerError, models.Message{"Error getting publishers"})
|
|
|
|
}
|
|
|
|
|
|
|
|
return c.JSON(http.StatusOK, list)
|
2017-11-07 15:35:10 +00:00
|
|
|
}
|