roh
Posts: 0
Joined: Sat Feb 14, 2015 12:07 am

Server code works in tester but not app

Server code works in tester but not app
/* Returns list of vendor details by vendorId */

var db_id = knowyeSettings.dbId;
var master_key = knowyeSettings.masterKey;

(function () {

var vendor_id = request.get("vendor_id");
console.log('vendor_id=',vendor_id);

if (!vendor_id) {
var err = 'Parameters required: vendor_id';
console.log('[Error] ' + err);
Apperyio.response.error({"message": err}, "application/json");
return;
}

var vendors = Collection.query(db_id, "vendor", {
"criteria": {
_id: vendor_id
},
"limit": 1,
"include": "state,country"
}, null, master_key);
console.log('Vendors found: '+vendors.length);

Code: Select all

 if (vendors.length  0) { 
     response.success(vendors[0], "application/json"); 
 } else { 
     response.success({}, "application/json"); 
 } 

})();

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

Server code works in tester but not app

Hello,

What exactly works wrong here? What parameters does it receive from the tester app and the real app? Please compare them and let us know the result.

Return to “Issues”