1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-13 23:03:32 +00:00

convert to using new sync api

This commit is contained in:
Kyle Spearrin
2017-09-20 12:28:41 -04:00
parent d1fb388ea3
commit fd538494c0
3 changed files with 122 additions and 182 deletions

View File

@@ -166,3 +166,27 @@ var DomainsResponse = function (response) {
this.globalEquivalentDomains.push(new GlobalDomainResponse(globalEquivalentDomains[i]));
}
};
var SyncResponse = function (response) {
if (response.Profile) {
this.profile = new ProfileResponse(response.Profile);
}
this.folders = [];
if (response.Folders) {
for (var i = 0; i < response.Folders.length; i++) {
this.folders.push(new FolderResponse(response.Folders[i]));
}
}
this.ciphers = [];
if (response.Ciphers) {
for (var i = 0; i < response.Ciphers.length; i++) {
this.ciphers.push(new CipherResponse(response.Ciphers[i]));
}
}
if (response.Domains) {
this.domains = new DomainsResponse(response.Domains);
}
};