1
0
mirror of https://github.com/raseels-repos/golang-saas-starter-kit.git synced 2025-06-15 00:15:15 +02:00

Complated web-api crud endpoints and unittests. unittest for find

endpoints still need to be implemented.
This commit is contained in:
Lee Brown
2019-06-27 04:48:18 -08:00
parent 48ae19bd6a
commit 24dd0dff42
27 changed files with 4062 additions and 1529 deletions

View File

@ -31,7 +31,7 @@ type Error struct {
func NewRequestError(err error, status int) error {
// if its a validation error then
if verr, ok := NewValidationError(err); ok {
if verr, ok := NewValidationError(err); ok {
return verr
}

View File

@ -83,7 +83,7 @@ func Decode(r *http.Request, val interface{}) error {
}
if err := validate.Struct(val); err != nil {
verr, _ := NewValidationError(err)
verr, _ := NewValidationError(err)
return verr
}
@ -130,7 +130,6 @@ func ExtractWhereArgs(where string) (string, []interface{}, error) {
return where, vals, nil
}
func RequestIsJson(r *http.Request) bool {
if r == nil {
return false
@ -155,4 +154,3 @@ func RequestIsJson(r *http.Request) bool {
return false
}