import { useSession } from 'src/composables/useSession';
import { getUrl } from './getUrl';

const { getTokenMultimedia } = useSession();
const token = getTokenMultimedia();

export async function downloadFile(id, model = 'dms', urlPath = '/downloadFile', url) {
    let appUrl = await getUrl('', 'lilium');
    appUrl = appUrl.replace('/#/', '');
    window.open(url ?? `${appUrl}/api/${model}/${id}${urlPath}?access_token=${token}`);
}
