This commit is contained in:
parent
d56c89ec2f
commit
fb45356a08
@ -33,11 +33,11 @@ func RegisterRoutes(e *echo.Echo, ctx *context.Context, cfg *config.Config) {
|
||||
var msg string
|
||||
err = c.Bind(ip)
|
||||
if err != nil {
|
||||
return JSONResult(c, fmt.Errorf("Error when parsing body"), "")
|
||||
return JSONResult(c, fmt.Errorf("error when parsing body"), "")
|
||||
}
|
||||
num, err := ip.InsertIP(cfg)
|
||||
if err != nil {
|
||||
return JSONResult(c, fmt.Errorf("Error inserting data"), "")
|
||||
return JSONResult(c, fmt.Errorf("error inserting data"), "")
|
||||
}
|
||||
if num > 0 {
|
||||
msg = fmt.Sprintf("Inserted %d IP", num)
|
||||
|
Loading…
Reference in New Issue
Block a user