$(document).on('click', '.quick-view-btn', function() {
const rowId = $(this).data('id');
const url = `{{ url('administrator/Careers/applied-candidate/get-details/') }}/${rowId}`;
getApplicationData(url).then((response) => {
// Do it your code
});
$("#quickViewModal").modal('show');
});
async function getApplicationData(url) {
try {
const response = await fetch(url, {
method: 'GET',
headers: {
'Content-type': 'application/json',
}
});
if (!response.ok) {
throw new Error(`Request failed with status: ${response.status}`);
}
return response.json();
} catch (error) {
throw error;
}
}
No comments:
Post a Comment