You've already forked golang-saas-starter-kit
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:
@ -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
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user