Web: Client: the format parameter is added by condition
This commit is contained in:
parent
01e7eefb52
commit
f7fd3bc30d
@ -113,8 +113,14 @@ const ConvertDialogComponent = (props) => {
|
||||
fileId: convertItem.id,
|
||||
toFolderId: folderId,
|
||||
action: "convert",
|
||||
format: selectedOptionType, // need backend
|
||||
};
|
||||
|
||||
if (isXML) {
|
||||
item.format = selectedOptionType;
|
||||
} else {
|
||||
item.format = null;
|
||||
}
|
||||
|
||||
item.fileInfo = convertItem;
|
||||
convertFile(item, t, convertItem.isOpen);
|
||||
} else {
|
||||
|
@ -447,7 +447,7 @@ class UploadDataStore {
|
||||
|
||||
while (index < len) {
|
||||
const conversionItem = filesToConversion[index];
|
||||
const { fileId, toFolderId, password } = conversionItem;
|
||||
const { fileId, toFolderId, password, format } = conversionItem;
|
||||
const itemPassword = password ? password : null;
|
||||
const file = this.files.find((f) => f.fileId === fileId);
|
||||
if (file) runInAction(() => (file.inConversion = true));
|
||||
@ -459,7 +459,7 @@ class UploadDataStore {
|
||||
|
||||
const numberFiles = this.files.filter((f) => f.needConvert).length;
|
||||
|
||||
const res = convertFile(fileId, itemPassword)
|
||||
const res = convertFile(fileId, format, itemPassword)
|
||||
.then((res) => res)
|
||||
.catch(() => {
|
||||
const error = t("FailedToConvert");
|
||||
|
@ -764,10 +764,11 @@ export async function getNewFiles(folderId: number) {
|
||||
// TODO: update res type
|
||||
export async function convertFile(
|
||||
fileId: string | number | null,
|
||||
format = null,
|
||||
password = null,
|
||||
sync = false,
|
||||
) {
|
||||
const data = { password, sync };
|
||||
const data = { password, sync, format };
|
||||
|
||||
const res = (await request({
|
||||
method: "put",
|
||||
|
Loading…
Reference in New Issue
Block a user