Include File size in SendRequest (#289)
This commit is contained in:
parent
70654926ad
commit
3942868cf4
|
@ -7,6 +7,7 @@ import { Send } from '../domain/send';
|
||||||
|
|
||||||
export class SendRequest {
|
export class SendRequest {
|
||||||
type: SendType;
|
type: SendType;
|
||||||
|
fileLength?: number;
|
||||||
name: string;
|
name: string;
|
||||||
notes: string;
|
notes: string;
|
||||||
key: string;
|
key: string;
|
||||||
|
@ -18,8 +19,9 @@ export class SendRequest {
|
||||||
password: string;
|
password: string;
|
||||||
disabled: boolean;
|
disabled: boolean;
|
||||||
|
|
||||||
constructor(send: Send) {
|
constructor(send: Send, fileLength?: number) {
|
||||||
this.type = send.type;
|
this.type = send.type;
|
||||||
|
this.fileLength = fileLength;
|
||||||
this.name = send.name ? send.name.encryptedString : null;
|
this.name = send.name ? send.name.encryptedString : null;
|
||||||
this.notes = send.notes ? send.notes.encryptedString : null;
|
this.notes = send.notes ? send.notes.encryptedString : null;
|
||||||
this.maxAccessCount = send.maxAccessCount;
|
this.maxAccessCount = send.maxAccessCount;
|
||||||
|
|
|
@ -127,7 +127,7 @@ export class SendService implements SendServiceAbstraction {
|
||||||
}
|
}
|
||||||
|
|
||||||
async saveWithServer(sendData: [Send, ArrayBuffer]): Promise<any> {
|
async saveWithServer(sendData: [Send, ArrayBuffer]): Promise<any> {
|
||||||
const request = new SendRequest(sendData[0]);
|
const request = new SendRequest(sendData[0], sendData[1]?.byteLength);
|
||||||
let response: SendResponse;
|
let response: SendResponse;
|
||||||
if (sendData[0].id == null) {
|
if (sendData[0].id == null) {
|
||||||
if (sendData[0].type === SendType.Text) {
|
if (sendData[0].type === SendType.Text) {
|
||||||
|
|
Loading…
Reference in New Issue