i have view page where i am trying to update the sortorder column everytime when user changes value in that particular column.so now the problem is when i update the value the page is refreshing..i would liek to stop that refreshing the page
Here is my scripting code:
function changeOrder(id, value)
{
var url = '{{ route('subject.update_sort') }}';
var dataset = {
id: id,
value: value,
};
axios.patch(url, dataset)
.then(function(response) {
Swal.fire({title: 'Updated!', text: response.data.message, type: 'success'})
.then(function(){
location.reload();
return false;
});
})
.catch(function(error) {
console.log(error);
Swal.fire({
type: 'error',
title: 'Oops...',
text: 'Something went wrong! '+error.response.data.message
})
})
}
Can anyone help me how can i do that..i try removing `location.reload` but when i did that the page is not refreshing but the sort order column is not coming in asc order. if i keep that back page is refreshing and the sort order column is coming in asc order.