Promise resolution where function is returned outside (jquery)

PHOTO EMBED

Fri Nov 20 2020 06:20:59 GMT+0000 (UTC)

Saved by @eneki

function refreshPendingIncidents() {
  return $.ajax({
    type: 'GET',
    url: '/pending-incidents/refresh/' + "{{ $reports[0]->id }}"
  });
}

refreshPendingIncidents().done(function(result) {
  console.log(result)
  console.log('res')
  }).fail(function() {
  	console.log('fail')
});
content_copyCOPY