mirror of
https://github.com/openclassify/openclassify.git
synced 2026-01-11 18:01:10 -06:00
Merge pull request #1110 from openclassify/dia
#4231 Crud Ajax Default Type
This commit is contained in:
commit
a9d0d80abf
@ -1,11 +1,14 @@
|
||||
function crudAjax(params, url, type, callback = () => {}, async = false) {
|
||||
function crudAjax(params, url, type = 'GET', callback = () => {}, async = true, options = {}) {
|
||||
return $.ajax({
|
||||
type: type,
|
||||
data: params,
|
||||
async: async,
|
||||
url: url,
|
||||
success: function (response) {
|
||||
callback(response);
|
||||
...{
|
||||
type: type,
|
||||
data: params,
|
||||
async: async,
|
||||
url: url,
|
||||
success: function (response) {
|
||||
callback(response);
|
||||
},
|
||||
},
|
||||
...options
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,11 +1,14 @@
|
||||
function crudAjax(params, url, type, callback, async = false) {
|
||||
function crudAjax(params, url, type = 'GET', callback = () => {}, async = true, options = {}) {
|
||||
return $.ajax({
|
||||
type: type,
|
||||
data: params,
|
||||
async: async,
|
||||
url: url,
|
||||
success: function (response) {
|
||||
callback(response);
|
||||
...{
|
||||
type: type,
|
||||
data: params,
|
||||
async: async,
|
||||
url: url,
|
||||
success: function (response) {
|
||||
callback(response);
|
||||
},
|
||||
},
|
||||
...options
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user