Proper payload for domain loggin type
This commit is contained in:
@@ -228,33 +228,23 @@ class WakaTimeCore {
|
|||||||
* @param debug
|
* @param debug
|
||||||
*/
|
*/
|
||||||
sendHeartbeat(entity, debug) {
|
sendHeartbeat(entity, debug) {
|
||||||
|
|
||||||
var payload = null;
|
var payload = null;
|
||||||
|
|
||||||
this._getLoggingType().done((loggingType) => {
|
this._getLoggingType().done((loggingType) => {
|
||||||
|
|
||||||
// Get only the domain from the entity.
|
// Get only the domain from the entity.
|
||||||
// And send that in heartbeat
|
// And send that in heartbeat
|
||||||
if (loggingType == 'domain') {
|
if (loggingType == 'domain') {
|
||||||
|
entity.url = getDomainFromUrl(entity.url);
|
||||||
var domain = getDomainFromUrl(entity);
|
payload = this._preparePayload(entity, 'domain', debug);
|
||||||
|
|
||||||
payload = this._preparePayload(domain, 'domain', debug);
|
|
||||||
|
|
||||||
console.log(payload);
|
console.log(payload);
|
||||||
|
|
||||||
this.sendAjaxRequestToApi(payload);
|
this.sendAjaxRequestToApi(payload);
|
||||||
|
|
||||||
}
|
}
|
||||||
// Send entity in heartbeat
|
// Send entity in heartbeat
|
||||||
else if (loggingType == 'url') {
|
else if (loggingType == 'url') {
|
||||||
payload = this._preparePayload(entity, 'url', debug);
|
payload = this._preparePayload(entity, 'url', debug);
|
||||||
|
|
||||||
console.log(payload);
|
console.log(payload);
|
||||||
|
|
||||||
this.sendAjaxRequestToApi(payload);
|
this.sendAjaxRequestToApi(payload);
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user