|
|
|
@ -1,6 +1,7 @@
|
|
|
|
|
package app
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"Lee-WineList/api"
|
|
|
|
|
"Lee-WineList/core"
|
|
|
|
|
"Lee-WineList/model/entity"
|
|
|
|
|
"Lee-WineList/model/param"
|
|
|
|
@ -76,7 +77,12 @@ func (w *wineApi) Delete(ctx *gin.Context) {
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if err := repository.Wine().Delete(p); err != nil {
|
|
|
|
|
var ue entity.User
|
|
|
|
|
if api.GetUser(ctx, &ue, false, true); ctx.IsAborted() {
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if err := repository.Wine().Delete(&p, &ue); err != nil {
|
|
|
|
|
core.R(ctx).FailWithMessage(err.Error())
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|