Last active
July 17, 2018 19:47
-
-
Save jschappet/11ab7156d2214f482ec4cd5203ae533f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
api.get('/', function (request) { | |
var uuid = "FAKE_UUID"; | |
var value = "543"; | |
var data = [ { | |
record_id: 0, | |
device_id: uuid, | |
bladder_pressure: value, | |
my_first_instrument_complete: "2" | |
}] | |
var opts = { | |
data: data, | |
type: 'flat', | |
forceAutoNumber: true, | |
returnContent: 'auto_ids', | |
overwriteBehavior: 'normal' | |
}; | |
redcap.records.import(opts, function (err, res) { | |
if (err) { | |
return "ERROR Posting record" | |
} | |
else { | |
return "Good stuff"; | |
} | |
}); | |
return "GOT TO THE END" | |
}); |
It should return the promise or else the server doesn't know the response hasn't finished
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I think it needs to return on line 22