Files
workavia-drive/tdrive/frontend/src/app/components/search-popup/common.tsx
T
Anton Shepilov d88feaaba8 🌟 Fix download button (#210)
* Add auth cookie to avoid using auth token in the url
* Fix all download button 
* Refactor some of the places where we download file
2023-09-21 14:08:57 +02:00

9 lines
328 B
TypeScript

import { DriveApiClient } from '@features/drive/api-client/api-client';
import { DriveItem } from '@features/drive/types';
export const onDriveItemDownloadClick = async (driveItem: DriveItem) => {
const url = await DriveApiClient.getDownloadUrl(driveItem.company_id, driveItem.id);
url && (window.location.href = url);
};