...
|
...
|
@@ -207,7 +207,7 @@ export function deleteOneHistory(skn, index) { |
|
|
|
|
|
let fetchList = (skn, uid, sourcePage) => {
|
|
|
dispatch(historyDeleteRequest());
|
|
|
return new BrowseService(app.host).deleteHistory(skn, uid, sourcePage)
|
|
|
return new BrowseService(app.host).deleteHistory(0, uid, sourcePage,skn)
|
|
|
.then(json => {
|
|
|
let {productList} = browse;
|
|
|
let lists = productList.toArray();
|
...
|
...
|
@@ -269,22 +269,16 @@ export function historyClearFailure(error) { |
|
|
};
|
|
|
}
|
|
|
|
|
|
export function clearHistory(selectedProducts) {
|
|
|
export function clearHistory(categoryID=0) {
|
|
|
return (dispatch, getState) => {
|
|
|
let skns = '';
|
|
|
for (var i = 0; i < selectedProducts.length; i++) {
|
|
|
skns = skns+selectedProducts[i].product_skn;
|
|
|
skns = skns+',';
|
|
|
}
|
|
|
let {app, browse} = getState();
|
|
|
|
|
|
if (browse.productList.size == 0) {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
let fetchList = (skns, uid, sourcePage) => {
|
|
|
let fetchList = (categoryID, uid, sourcePage) => {
|
|
|
dispatch(historyClearRequest());
|
|
|
return new BrowseService(app.host).deleteHistory(skns, uid, sourcePage)
|
|
|
return new BrowseService(app.host).deleteHistory(categoryID, uid, sourcePage,)
|
|
|
.then(json => {
|
|
|
dispatch(historyClearSuccess());
|
|
|
dispatch(historySortList());
|
...
|
...
|
@@ -307,7 +301,7 @@ export function clearHistory(selectedProducts) { |
|
|
return ReactNative.NativeModules.YH_CommonHelper.uid();
|
|
|
}).then(data => {
|
|
|
uid = data;
|
|
|
fetchList(skns, uid, sourcePage);
|
|
|
fetchList(categoryID, uid, sourcePage);
|
|
|
})
|
|
|
.catch(error => {
|
|
|
|
...
|
...
|
|