mirror of
https://github.com/bitwarden/browser
synced 2025-12-16 16:23:44 +00:00
Remove unused toData methods (#245)
This commit is contained in:
@@ -103,38 +103,4 @@ export class Send extends Domain {
|
|||||||
|
|
||||||
return model;
|
return model;
|
||||||
}
|
}
|
||||||
|
|
||||||
toSendData(userId: string): SendData {
|
|
||||||
const s = new SendData();
|
|
||||||
s.id = this.id;
|
|
||||||
s.accessId = this.accessId;
|
|
||||||
s.userId = userId;
|
|
||||||
s.maxAccessCount = this.maxAccessCount;
|
|
||||||
s.accessCount = this.accessCount;
|
|
||||||
s.disabled = this.disabled;
|
|
||||||
s.password = this.password;
|
|
||||||
s.revisionDate = this.revisionDate != null ? this.revisionDate.toISOString() : null;
|
|
||||||
s.deletionDate = this.deletionDate != null ? this.deletionDate.toISOString() : null;
|
|
||||||
s.expirationDate = this.expirationDate != null ? this.expirationDate.toISOString() : null;
|
|
||||||
s.type = this.type;
|
|
||||||
|
|
||||||
this.buildDataModel(this, s, {
|
|
||||||
name: null,
|
|
||||||
notes: null,
|
|
||||||
key: null,
|
|
||||||
});
|
|
||||||
|
|
||||||
switch (s.type) {
|
|
||||||
case SendType.File:
|
|
||||||
s.text = this.text.toSendTextData();
|
|
||||||
break;
|
|
||||||
case SendType.Text:
|
|
||||||
s.file = this.file.toSendFileData();
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
return s;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,16 +34,4 @@ export class SendFile extends Domain {
|
|||||||
}, null, key);
|
}, null, key);
|
||||||
return view;
|
return view;
|
||||||
}
|
}
|
||||||
|
|
||||||
toSendFileData(): SendFileData {
|
|
||||||
const f = new SendFileData();
|
|
||||||
f.size = this.size;
|
|
||||||
this.buildDataModel(this, f, {
|
|
||||||
id: null,
|
|
||||||
url: null,
|
|
||||||
sizeName: null,
|
|
||||||
fileName: null,
|
|
||||||
}, ['id', 'url', 'sizeName']);
|
|
||||||
return f;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,13 +27,4 @@ export class SendText extends Domain {
|
|||||||
text: null,
|
text: null,
|
||||||
}, null, key);
|
}, null, key);
|
||||||
}
|
}
|
||||||
|
|
||||||
toSendTextData(): SendTextData {
|
|
||||||
const t = new SendTextData();
|
|
||||||
this.buildDataModel(this, t, {
|
|
||||||
text: null,
|
|
||||||
hidden: null,
|
|
||||||
}, ['hidden']);
|
|
||||||
return t;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user