Found more JSON properties to change into JavaScript camelCase

This commit is contained in:
the-djmaze 2023-01-26 10:41:55 +01:00
parent b9ef8ae2c9
commit 974350ebee
45 changed files with 361 additions and 412 deletions

View file

@ -12,6 +12,7 @@ import { SettingsUserStore } from 'Stores/User/Settings';
import * as Local from 'Storage/Client';
import { ThemeStore } from 'Stores/Theme';
import Remote from 'Remote/User/Fetch';
import { attachmentDownload } from 'Common/Links';
export const
@ -42,6 +43,28 @@ download = (link, name = "") => {
}
},
downloadZip = (hashes, onError, fTrigger, folder) => {
if (hashes.length) {
let params = {
target: 'zip',
hashes: hashes
};
if (!onError) {
onError = () => alert('Download failed');
}
if (folder) {
params.folder = folder;
// params.uids = uids;
}
Remote.post('AttachmentsActions', fTrigger || null, params)
.then(result => {
let hash = result?.Result?.fileHash;
hash ? download(attachmentDownload(hash), hash+'.zip') : onError();
})
.catch(onError);
}
},
/**
* @returns {function}
*/