wip
This commit is contained in:
@@ -89,9 +89,7 @@ func (cr *CarController) GetAll(c *gin.Context) {
|
||||
|
||||
func (cr *CarController) Delete(c *gin.Context) {
|
||||
type input struct {
|
||||
Car struct {
|
||||
ID uint `json:"id" binding:"required,numeric"`
|
||||
} `json:"car"`
|
||||
ID uint `json:"id" binding:"required,numeric"`
|
||||
}
|
||||
var deleteData input
|
||||
requestUser, err := cr.UserService.FromContext(c)
|
||||
@@ -109,7 +107,7 @@ func (cr *CarController) Delete(c *gin.Context) {
|
||||
utils.HandleValidationError(c, err)
|
||||
return
|
||||
}
|
||||
err = cr.S.Delete(&deleteData.Car.ID)
|
||||
err = cr.S.Delete(&deleteData.ID)
|
||||
if err != nil {
|
||||
utils.RespondWithError(c, err, "Error deleting car", http.StatusInternalServerError, errors.Responses.Fields.Car, errors.Responses.Keys.InternalServerError)
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user