Get username from uid
-
I'm writing a plugin that uses the action:post.save hook
I've got the plug-in logging the post data to the console fine.Im then trying to fetch the username from the uid from the post data.
my basic library.js is:var User = module.parent.require('./user';); module.exports.emailalert = function(postData) { console.log(postData.uid); // this is returning '2' User.getUserField(postData.uid, 'username', function(data){ console.log(data); // this is returning 'null' }); };
however User.getUserField is returning null.
User module is definitely getting called.
Copyright © 2024 NodeBB | Contributors