- check status in CancelPromotion.
- return more accurate error in user related funcs
This commit is contained in:
@@ -555,6 +555,9 @@ func CancelJdPromotion(ctx *jxcontext.Context, promotionID int) (err error) {
|
||||
if err = dao.GetEntity(db, promotion); err != nil {
|
||||
return err
|
||||
}
|
||||
if promotion.Status != model.PromotionStatusRemoteCreated {
|
||||
return errors.New("当前状态不能进行取消操作")
|
||||
}
|
||||
promotionHandler := getPromotionHander(promotion.Type)
|
||||
if promotionHandler == nil {
|
||||
return errors.New("非法的促销类型")
|
||||
|
||||
Reference in New Issue
Block a user