Commit 073a362b by rajshah

feat: download count in resource detail v0.5

parent 4ebfec1e
......@@ -612,7 +612,7 @@
jQuery(document).ready(function ($) {
$('#btn-resource-download').on('click', function () {
const resourceId = $(this).data('resource-id');
console.log(resourceId);
$.ajax({
url: frontend_ajax_object.ajax_url,
type: "POST",
......@@ -621,6 +621,7 @@ jQuery(document).ready(function ($) {
resource_id: resourceId,
},
success: function (response) {
console.log(response);
if (response.success) {
$("#download-count").text(response.new_count);
} else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment