...
|
...
|
@@ -4,12 +4,11 @@ |
|
|
|
|
|
const library = '../../../library';
|
|
|
const API = require(`${library}/api`).API;
|
|
|
const ServiceAPI = require(`${library}/api`).ServiceAPI;
|
|
|
const sign = require(`${library}/sign`);
|
|
|
|
|
|
const api = new API();
|
|
|
|
|
|
module.exports.getUidProductFavAsync = function (uid, pid) {
|
|
|
module.exports.isFavoriteAsync = function (uid, pid) {
|
|
|
return api.get('', sign.apiSign({
|
|
|
method: 'app.favorite.isFavorite',
|
|
|
id: pid,
|
...
|
...
|
@@ -17,3 +16,21 @@ module.exports.getUidProductFavAsync = function (uid, pid) { |
|
|
type: 'product'
|
|
|
}));
|
|
|
};
|
|
|
|
|
|
module.exports.createAsync = function (uid, pid) {
|
|
|
return api.get('', sign.apiSign({
|
|
|
method: 'app.favorite.add',
|
|
|
id: pid,
|
|
|
uid: uid,
|
|
|
type: 'product'
|
|
|
}));
|
|
|
};
|
|
|
|
|
|
module.exports.deleteAsync = function (uid, pid) {
|
|
|
return api.get('', sign.apiSign({
|
|
|
method: 'app.favorite.cancel',
|
|
|
fav_id: pid,
|
|
|
uid: uid,
|
|
|
type: 'product'
|
|
|
}));
|
|
|
}; |
...
|
...
|
|