...
|
...
|
@@ -308,20 +308,20 @@ export function addFavorite() { |
|
|
};
|
|
|
}
|
|
|
|
|
|
export function addFavoriteRequest(){
|
|
|
export function cancelFavoriteRequest(){
|
|
|
return {
|
|
|
type: CANCEL_FAVORITE_REQUEST,
|
|
|
};
|
|
|
}
|
|
|
|
|
|
export function addFavoriteSuccess(json){
|
|
|
export function cancelFavoriteSuccess(json){
|
|
|
return {
|
|
|
type: CANCEL_FAVORITE_SUCCESS,
|
|
|
payload:json
|
|
|
};
|
|
|
}
|
|
|
|
|
|
export function addFavoriteFailure(){
|
|
|
export function cancelFavoriteFailure(){
|
|
|
return {
|
|
|
type: CANCEL_FAVORITE_FAILURE,
|
|
|
};
|
...
|
...
|
@@ -333,13 +333,13 @@ export function cancelFavorite() { |
|
|
let {brandId} = detail;
|
|
|
|
|
|
let favoriteRequest = (brandId, uid) => {
|
|
|
dispatch(addFavoriteRequest());
|
|
|
dispatch(addFavoriteSuccess());
|
|
|
dispatch(cancelFavoriteRequest());
|
|
|
dispatch(cancelFavoriteSuccess());
|
|
|
return new DetailService(app.host).cancelFavorite(brandId, uid)
|
|
|
.then(json => {
|
|
|
})
|
|
|
.catch(error => {
|
|
|
dispatch(addFavoriteFailure(error));
|
|
|
dispatch(cancelFavoriteFailure(error));
|
|
|
});
|
|
|
}
|
|
|
|
...
|
...
|
@@ -358,4 +358,3 @@ export function cancelFavorite() { |
|
|
});
|
|
|
};
|
|
|
} |
|
|
|
...
|
...
|
|