deleting agree disclaimer flag in storage and adding to the storage profile

This commit is contained in:
Gabriel Bazán 2015-11-30 12:58:52 -03:00
commit 3f7485ca8d
7 changed files with 62 additions and 58 deletions

View file

@ -15,15 +15,16 @@ Profile.create = function(opts) {
var x = new Profile();
x.createdOn = Date.now();
x.credentials = opts.credentials || [];
x.agreeDisclaimer = false;
return x;
};
Profile.fromObj = function(obj) {
var x = new Profile();
x.createdOn = obj.createdOn;
x.credentials = obj.credentials;
x.agreeDisclaimer = obj.agreeDisclaimer;
if (x.credentials[0] && typeof x.credentials[0] != 'object')
throw ("credentials should be an object");
@ -31,7 +32,6 @@ Profile.fromObj = function(obj) {
return x;
};
Profile.fromString = function(str) {
return Profile.fromObj(JSON.parse(str));
};
@ -39,5 +39,3 @@ Profile.fromString = function(str) {
Profile.prototype.toObj = function() {
return JSON.stringify(this);
};