Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2019
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. var Base = require('models/base.js');
  2.  
  3. var User = module.exports = function(data) {
  4. data = data || {};
  5. this.fname = data.fname || '';
  6. this.lname = data.lname || '';
  7. this.email = data.email || '';
  8. };
  9.  
  10. /**
  11. * Takes a response from FB and convert it to object
  12. */
  13. User.prototype.importFacebookData = function(result) {
  14.  
  15. this.fname = result.first_name || '';
  16. this.lname = result.last_name || '';
  17. this.name = result.name || this.fname + ' ' + this.lname || '';
  18. this.email = result.email || '';
  19. };
  20.  
  21. var Base = module.exports = function() {
  22.  
  23. };
  24.  
  25. Base.prototype.save = function() {
  26. // Some code for saving to DB
  27. };
  28.  
  29. User.prototype = new Base();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement