Authored by htoooth

refactor brand

... ... @@ -17,7 +17,7 @@ module.exports.changeFavoriteBrand = (req, res, next) => {
let brandId = req.body.brandId;
if (uid && brandId) {
service.changeFavoriteBrandAsync(uid, brandId).then(result => {
service.changeAsync(uid, brandId).then(result => {
res.json(result)
}).catch(next);
} else if (!uid) {
... ...
... ... @@ -100,7 +100,7 @@ const getProductFavoriteData = (uid, pid, bid) => {
}
if (bid) {
let brandData = yield favoriteBrandService.isFavoriteBrandAsync(uid, bid);
let brandData = yield favoriteBrandService.isFavoriteAsync(uid, bid);
result.brand = brandData.code && brandData.code === 200 ? true : false;
}
... ...
... ... @@ -8,14 +8,14 @@ const sign = require(`${library}/sign`);
const api = new API();
const serviceAPI = new ServiceAPI();
module.exports.isFavoriteBrandAsync = function (uid, bid) {
module.exports.isFavoriteAsync = function (uid, bid) {
return serviceAPI.get('shops/service/v1/favorite/getUidBrandFav', sign.apiSign({
uid: uid,
brandId: bid
}));
};
module.exports.changeFavoriteBrandAsync = function (uid, brandId) {
module.exports.changeAsync = function (uid, brandId) {
return serviceAPI.get('guang/service/v2/favorite/toggleBrand', sign.apiSign({
uid: uid,
brand_id: brandId
... ...
... ... @@ -6,7 +6,7 @@
const favoriteBrandAPI = require('./favorite-brand-api');
module.exports.changeFavoriteBrandAsync = favoriteBrandAPI.changeFavoriteBrandAsync;
module.exports.changeAsync = favoriteBrandAPI.changeAsync;
module.exports.isFavoriteBrandAsync = favoriteBrandAPI.isFavoriteBrandAsync;
module.exports.isFavoriteAsync = favoriteBrandAPI.isFavoriteAsync;
... ...