add convertTo for fileUpload

This commit is contained in:
smanylov
2026-02-25 20:04:34 +07:00
parent c8f2233e24
commit de7199a3df
+6 -1
View File
@@ -11,7 +11,8 @@ interface initMessageBody {
extension: string, extension: string,
file_size: number | string, file_size: number | string,
action?: string, action?: string,
token?: string token?: string,
convertTo? : string | undefined | null
} }
export async function fileUpload(messageBody: initMessageBody, convertTo?: string | null | undefined) { export async function fileUpload(messageBody: initMessageBody, convertTo?: string | null | undefined) {
@@ -23,6 +24,10 @@ export async function fileUpload(messageBody: initMessageBody, convertTo?: strin
message.action = 'init'; message.action = 'init';
message.token = token; message.token = token;
if (convertTo && convertTo !== 'reject') {
message.convertTo = convertTo;
}
// нужно будет добавить свойство convertTo в тело запроса он может прийти со значением reject тогда конвертировать не нужно. // нужно будет добавить свойство convertTo в тело запроса он может прийти со значением reject тогда конвертировать не нужно.
// console.log(convertTo); // console.log(convertTo);