Custom database scripts not working properly

I have two scripts setup:

GetByEmail:

function getByEmail (email, callback) {
var request = require(‘request’);
//console.log(email);
request.get(
http://api.xxxx.com/users?email=”+email,
function (err, response, body) {
if(err) {
return callback(new Error(err));
}
if(response.statusCode !== 200) {
return callback(new Error(body));
}
callback(null, {
user_id: 123456789,
email: email
});
}
);
}

This one works great.

Then I try to implement custom Create:

function create (user, callback) {
console.log(‘hiiiii’);
callback(null, {});
}

This one has problems. It keeps saying Error. According to wt console sending logs, the GetByEmail script is being sent properly with 200 HTTP code, but then next should be run the create script and it isnt.

Please, can you help me with this case?

Hey @jd1!

As it has been more than a few months since this topic was opened and there has been no reply or further information provided from the community as to the existence of the issue we would like to check if you are still facing the described challenge?

We are more than happy to assist in any way! If the issue is still out there please let us know so we can create a new thread for better visibility, otherwise we’ll close this one in week’s time.

Thank you!

This topic was automatically closed after 5 days. New replies are no longer allowed.