stringify callbacks

This commit is contained in:
jane 2021-06-04 22:28:00 -04:00
parent a4b28f5cdb
commit 5ef3a74b15
1 changed files with 2 additions and 2 deletions

View File

@ -31,11 +31,11 @@ export function recv(callback, errorCallback) {
if (parsed_data.errors != undefined && parsed_data.errors.length > 0) { if (parsed_data.errors != undefined && parsed_data.errors.length > 0) {
con.write(`error ..\n${JSON.stringify(parsed_data)}`); con.write(`error ..\n${JSON.stringify(parsed_data)}`);
errorCallback(parsed_data); errorCallback(JSON.stringify(parsed_data));
} }
else { else {
con.write(`success ..\n${JSON.stringify(parsed_data)}`); con.write(`success ..\n${JSON.stringify(parsed_data)}`);
callback(parsed_data); callback(JSON.stringify(parsed_data));
} }
}); });
con.on('close', () => { con.on('close', () => {