mtwmapi.IsErrCategoryNotExist考虑使用RetailCatSkuBatchDelete2的情况

This commit is contained in:
gazebo
2019-10-24 16:13:38 +08:00
parent 6b72460528
commit cef043546f
2 changed files with 5 additions and 1 deletions

View File

@@ -453,7 +453,10 @@ func IsErrCategoryExist(err error) (isExist bool) {
}
func IsErrCategoryNotExist(err error) (isNotExist bool) {
return utils.IsErrMatch(err, utils.Int2Str(ErrCodeSkuCategoryNotExist), nil)
return utils.IsErrMatch(err, utils.Int2Str(ErrCodeSkuCategoryNotExist), nil) ||
utils.IsErrMatch(err, utils.Int2Str(ErrCodeParameterFormatWrong), []string{
"门店内不存在该分类",
})
}
func IsErrSkuNotExist(err error) (isExist bool) {

View File

@@ -88,6 +88,7 @@ func TestRetailGetSpTagIds(t *testing.T) {
func TestRetailCatSkuBatchDelete(t *testing.T) {
err := api.RetailCatSkuBatchDelete2(utils.GetUUID(), testPoiCode, nil, []string{"精品水果2"}, nil, nil, nil)
t.Log(IsErrCategoryNotExist(err))
if err != nil {
t.Fatal(err)
}