1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-21 02:33:46 +00:00

Simplify send templates (#237)

* Simplify Send templates

* Fix internal template reference

* No trailing whitespace
This commit is contained in:
Matt Gibson
2021-02-26 12:47:11 -06:00
committed by GitHub
parent 2c11e5d6a9
commit e77e1c94e8
3 changed files with 8 additions and 9 deletions

View File

@@ -14,13 +14,13 @@ const dateProperties: string[] = [Utils.nameOf<SendResponse>('deletionDate'), Ut
export class SendResponse implements BaseResponse {
static template(deleteInDays = 7): SendResponse {
static template(sendType?: SendType, deleteInDays = 7): SendResponse {
const req = new SendResponse();
req.name = 'Send name';
req.notes = 'Some notes about this send.';
req.type = SendType.Text;
req.text = null;
req.file = null;
req.text = sendType === SendType.Text ? SendTextResponse.template() : null;
req.file = sendType === SendType.File ? SendFileResponse.template() : null;
req.maxAccessCount = null;
req.deletionDate = this.getStandardDeletionDate(deleteInDays);
req.expirationDate = null;