🐛Fix downloading by shared link (#118)
This commit is contained in:
@@ -120,17 +120,12 @@ export class DriveApiClient {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static async getDownloadUrl(companyId: string, id: string, versionId?: string) {
|
static async getDownloadUrl(companyId: string, id: string, versionId?: string) {
|
||||||
const { token } = await DriveApiClient.getDownloadToken(companyId, [id], versionId);
|
|
||||||
if (versionId)
|
if (versionId)
|
||||||
return Api.route(
|
return Api.route(
|
||||||
`/internal/services/documents/v1/companies/${companyId}/item/${id}/download?version_id=${versionId}&token=${token}${appendTdriveToken(
|
`/internal/services/files/v1/companies/${companyId}/files/${id}/download?version_id=${versionId}`,
|
||||||
true,
|
|
||||||
)}`,
|
|
||||||
);
|
);
|
||||||
return Api.route(
|
return Api.route(
|
||||||
`/internal/services/documents/v1/companies/${companyId}/item/${id}/download?token=${token}${appendTdriveToken(
|
`/internal/services/files/v1/companies/${companyId}/files/${id}/download`,
|
||||||
true,
|
|
||||||
)}`,
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ export const useOnBuildContextMenu = (children: DriveItem[], initialParentId?: s
|
|||||||
{
|
{
|
||||||
type: 'menu',
|
type: 'menu',
|
||||||
text: Languages.t('components.item_context_menu.download'),
|
text: Languages.t('components.item_context_menu.download'),
|
||||||
onClick: () => download(item.id),
|
onClick: () => download(item.last_version_cache.file_metadata.external_id),
|
||||||
},
|
},
|
||||||
{ type: 'separator' },
|
{ type: 'separator' },
|
||||||
{
|
{
|
||||||
@@ -444,6 +444,7 @@ export const useOnBuildFileContextMenu = () => {
|
|||||||
const { open: preview } = useDrivePreview();
|
const { open: preview } = useDrivePreview();
|
||||||
return useCallback(
|
return useCallback(
|
||||||
(item: DriveItem) => {
|
(item: DriveItem) => {
|
||||||
|
console.log(item);
|
||||||
const menuItems = [
|
const menuItems = [
|
||||||
{
|
{
|
||||||
type: 'menu',
|
type: 'menu',
|
||||||
|
|||||||
Reference in New Issue
Block a user