new api integrated

This commit is contained in:
2017-10-29 12:04:30 +01:00
parent 1c9739c5cf
commit 4f4e072542
12 changed files with 174 additions and 36 deletions

View File

@@ -12,7 +12,8 @@ var Sui = {
let update = function(endpoint, method, props) {
Sui.http.ajax({
method: method,
endpoint: node.api[endpoint] + (props ? props.join('/') : ''),
endpoint: node.api[endpoint],
data: props,
cache: false
}, actuator.onResponse || null);
};
@@ -20,7 +21,7 @@ var Sui = {
let handle = function(event) {
update.call(this,
actuator.api,
'GET',
actuator.method,
actuator.data ?
actuator.data.call(this) : [this.value]
);
@@ -60,7 +61,7 @@ var Sui = {
if(!cache) {
data['_'] = new Date().getTime();
}
var serializedData = Sui.util.serialize(data);
var serializedData = data; //Sui.util.serialize(data);
var endPointUrl = (config.method === 'GET' || config.method === 'DELETE') && data ? config.endpoint+'?'+serializedData : config.endpoint;
var postData = config.method === 'POST' || config.method === 'PUT' ? serializedData : null;