Skip to content

Commit

Permalink
updates to support 10.0.0 SDK
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonkneen committed Sep 7, 2021
1 parent 47a9cbf commit a0092c0
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions reste.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ var main = function () {
var reste = this;

var config = {},
requestHeaders = [];
requestHeaders = [];

function log(message) {
if (config.debug && message) {
Expand Down Expand Up @@ -78,7 +78,7 @@ var main = function () {

var formEncode = false;

http.setTimeout(config.timeout || 10000);
http.timeout = config.timeout || 10000;

if (_.has(config, "validatesSecureCertificate")) {
http.setValidatesSecureCertificate(config.validatesSecureCertificate);
Expand Down Expand Up @@ -199,8 +199,8 @@ var main = function () {
for (var header in headers) {
requestHeaders.push({
name: header,
value: headers[header]
});
value: headers[header] });

}
};

Expand All @@ -216,8 +216,8 @@ var main = function () {
if (!changed) {
requestHeaders.push({
name: Object.keys(header)[0],
value: header[Object.keys(header)[0]]
});
value: header[Object.keys(header)[0]] });

}
};

Expand All @@ -236,9 +236,9 @@ var main = function () {

reste[args.name] = function (params, onLoad, onError) {
var body,
method = "GET",
url,
deferred;
method = "GET",
url,
deferred;

if (args.post) method = "POST";
if (args.get) method = "GET";
Expand Down Expand Up @@ -298,12 +298,12 @@ var main = function () {
params: body,
headers: args.requestHeaders || args.headers,
beforePost: args.beforePost,
beforeSend: args.beforeSend
}, onLoad, onError);
beforeSend: args.beforeSend },
onLoad, onError);
} else {
var m,
missing = [],
re = /(\<\w*\>)/g;
missing = [],
re = /(\<\w*\>)/g;

if (config.autoValidateParams) {
while ((m = re.exec(url)) !== null) {
Expand All @@ -324,8 +324,8 @@ var main = function () {
params: body,
headers: args.requestHeaders || args.headers,
beforePost: args.beforePost,
beforeSend: args.beforeSend
}, onLoad, onError);
beforeSend: args.beforeSend },
onLoad, onError);
}
}

Expand Down Expand Up @@ -396,8 +396,8 @@ var main = function () {
this.__transform = this.toJSON();
}
return this.__transform;
}
});
} });


if (args.collections) {
args.collections.forEach(function (collection) {
Expand All @@ -417,8 +417,8 @@ var main = function () {

if (model instanceof Backbone.Collection && modelConfig && modelConfig.collections) {
var collectionConfig = _.where(modelConfig.collections, {
name: model._name
})[0];
name: model._name })[
0];

var methodCall = reste[collectionConfig.read];

Expand Down Expand Up @@ -533,8 +533,8 @@ var main = function () {
} : onError = null;

reste[modelConfig.create]({
body: body
}, function (e) {
body: body },
function (e) {

if (e.code > 200) {
onError(e);
Expand Down

0 comments on commit a0092c0

Please sign in to comment.