favorite-brand-service.js 512 Bytes
/**
 * Created by TaoHuang on 2016/6/13.
 */

'use strict';

const api = require('./favorite-brand-api');

const changeAsync = (type, uid, brandId) => {
    switch (type) {
        case 'add':
            return api.addFavAsync(uid, brandId);
        case 'cancel' :
            return api.cancelFavAsync(uid, brandId);
        default:
            return Promise.reject('favorite brand error');
    }
};

const isFavoriteAsync = api.isFavoriteAsync;

module.exports = {
    changeAsync,
    isFavoriteAsync
};