added output port for storage-write that gives status

This commit is contained in:
Peter Svensson
2019-07-08 15:10:26 +02:00
parent a41df8813f
commit 48910a9700
3 changed files with 4 additions and 2 deletions

View File

@ -10,7 +10,7 @@
cred: {value: "", type: 'firebase-config'}
},
inputs:1,
outputs:0,
outputs:1,
icon: "storage.png",
label: function() {
return this.name||"storage-write";

View File

@ -33,8 +33,10 @@ module.exports = function(RED) {
file.save(contents, options, function(err) {
if (!err) {
// File written successfully.
node.send({payload:{success:true, filename: path}})
} else {
console.log('cloud storage write error: '+err)
node.send({payload:{success:false, filename: path}})
}
});
}