interface AjaxResponse {
returnValues: {
- objectID: number;
+ objectID: number | string;
objectType: string;
reactions: ReactionStats;
reactionTypeID: number;
}
_ajaxSuccess(data: AjaxResponse): void {
- this.countButtons.updateCountButtons(data.returnValues.objectID, data.returnValues.reactions);
+ const objectId = ~data.returnValues.objectID;
+ this.countButtons.updateCountButtons(objectId, data.returnValues.reactions);
- this._updateReactButton(data.returnValues.objectID, data.returnValues.reactionTypeID);
+ this._updateReactButton(objectId, data.returnValues.reactionTypeID);
}
_ajaxSetup(): ReturnType<AjaxCallbackSetup> {
this._closePopover();
}
_ajaxSuccess(data) {
- this.countButtons.updateCountButtons(data.returnValues.objectID, data.returnValues.reactions);
- this._updateReactButton(data.returnValues.objectID, data.returnValues.reactionTypeID);
+ const objectId = ~data.returnValues.objectID;
+ this.countButtons.updateCountButtons(objectId, data.returnValues.reactions);
+ this._updateReactButton(objectId, data.returnValues.reactionTypeID);
}
_ajaxSetup() {
return {