#2078 - fix BindJSON calls
This commit is contained in:
@@ -15,7 +15,10 @@ func postServerBackup(c *gin.Context) {
|
||||
s := GetServer(c.Param("server"))
|
||||
|
||||
data := &backup.Request{}
|
||||
c.BindJSON(&data)
|
||||
// BindJSON sends 400 if the request fails, all we need to do is return
|
||||
if err := c.BindJSON(&data); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
var adapter backup.BackupInterface
|
||||
var err error
|
||||
@@ -41,7 +44,6 @@ func postServerBackup(c *gin.Context) {
|
||||
}
|
||||
}(adapter, s)
|
||||
|
||||
|
||||
c.Status(http.StatusAccepted)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user