This commit is contained in:
kolaente 2017-11-28 16:04:14 +01:00
parent 50b368320a
commit c6ae207c9b
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
3 changed files with 4 additions and 5 deletions

View File

@ -6,8 +6,8 @@ import (
"git.mowie.cc/konrad/Library/models" "git.mowie.cc/konrad/Library/models"
"github.com/labstack/echo" "github.com/labstack/echo"
"net/http" "net/http"
"strings"
"strconv" "strconv"
"strings"
) )
type authorPayload struct { type authorPayload struct {
@ -41,7 +41,7 @@ func AuthorAddOrUpdate(c echo.Context) error {
if datAuthor.Lastname == "" && datAuthor.Forename == "" { if datAuthor.Lastname == "" && datAuthor.Forename == "" {
return c.JSON(http.StatusBadRequest, models.Message{"Please provide at least one name."}) return c.JSON(http.StatusBadRequest, models.Message{"Please provide at least one name."})
} }
// Check if we have an ID other than the one in the struct // Check if we have an ID other than the one in the struct
id := c.Param("id") id := c.Param("id")
if id != "" { if id != "" {

View File

@ -6,8 +6,8 @@ import (
"git.mowie.cc/konrad/Library/models" "git.mowie.cc/konrad/Library/models"
"github.com/labstack/echo" "github.com/labstack/echo"
"net/http" "net/http"
"strings"
"strconv" "strconv"
"strings"
) )
type bookPayload struct { type bookPayload struct {

View File

@ -6,8 +6,8 @@ import (
"git.mowie.cc/konrad/Library/models" "git.mowie.cc/konrad/Library/models"
"github.com/labstack/echo" "github.com/labstack/echo"
"net/http" "net/http"
"strings"
"strconv" "strconv"
"strings"
) )
type publisherPayload struct { type publisherPayload struct {
@ -37,7 +37,6 @@ func PublisherAddOrUpdate(c echo.Context) error {
} }
} }
// Check if we have an ID other than the one in the struct // Check if we have an ID other than the one in the struct
id := c.Param("id") id := c.Param("id")
if id != "" { if id != "" {