mirror of
https://github.com/pierre42100/ComunicWeb
synced 2024-11-29 23:36:27 +00:00
29 lines
500 B
JavaScript
29 lines
500 B
JavaScript
/**
|
|
* Likes API interface
|
|
*
|
|
* @author Pierre HUBERT
|
|
*/
|
|
|
|
ComunicWeb.components.like.interface = {
|
|
|
|
/**
|
|
* Update like status
|
|
*
|
|
* @param {String} type The type of component
|
|
* @param {Integer} id The ID of the element
|
|
* @param {Boolean} like New like status
|
|
*/
|
|
update: function(type, id, like){
|
|
|
|
//Perform an API request
|
|
var apiURI = "likes/update";
|
|
var params = {
|
|
type: type,
|
|
id: id,
|
|
like: like
|
|
};
|
|
ComunicWeb.common.api.makeAPIrequest(apiURI, params, true);
|
|
|
|
}
|
|
|
|
} |