Library/routes/api/v1/publishers_list.go
konrad 2e360becca implemented authors and publishers search
Signed-off-by: kolaente <konrad@kola-entertainments.de>
2017-10-10 21:58:55 +02:00

18 lines
337 B
Go

package v1
import (
"github.com/labstack/echo"
"net/http"
"git.mowie.cc/konrad/Library/models"
)
func PublishersList(c echo.Context) error {
list, err := models.ListPublishers("")
if err != nil{
return c.JSON(http.StatusInternalServerError, models.Message{"Error getting publishers"})
}
return c.JSON(http.StatusOK, list)
}