From 5fb3c2ba0d8fad02c19dff2cf5bfcddf5a77a6e8 Mon Sep 17 00:00:00 2001 From: mbaharip <62494292+mbahArip@users.noreply.github.com> Date: Tue, 23 Apr 2024 11:57:57 +0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9E=20fix:=20Missing=20`supportAllDriv?= =?UTF-8?q?es`=20when=20getting=20files?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/[...rest]/page.tsx | 3 +++ src/app/actions.ts | 2 ++ src/app/api/download/[encryptedId]/route.ts | 1 + 3 files changed, 6 insertions(+) diff --git a/src/app/[...rest]/page.tsx b/src/app/[...rest]/page.tsx index 97baa60..ad3f6e9 100644 --- a/src/app/[...rest]/page.tsx +++ b/src/app/[...rest]/page.tsx @@ -11,6 +11,8 @@ import { decryptData } from "~/utils/encryptionHelper/hash"; import gdrive from "~/utils/gdriveInstance"; import { getFileType } from "~/utils/previewHelper"; +import config from "~/config/gIndex.config"; + import FileBrowser from "../@explorer"; import Header from "../@header"; import HeaderButton from "../@header.button"; @@ -102,6 +104,7 @@ export default async function RestPage({ params: { rest } }: Props) { const { data: file } = await gdrive.files.get({ fileId: await decryptData(encryptedId), fields: "mimeType, fileExtension", + supportsAllDrives: config.apiConfig.isTeamDrive, }); if (!file.mimeType?.includes("folder")) { promise.push(GetFile(encryptedId)); diff --git a/src/app/actions.ts b/src/app/actions.ts index 3e6e22a..f123aea 100644 --- a/src/app/actions.ts +++ b/src/app/actions.ts @@ -258,6 +258,7 @@ export async function CheckPassword( { fileId: protectedFolder.id as string, alt: "media", + supportsAllDrives: config.apiConfig.isTeamDrive, }, { responseType: "text", @@ -637,6 +638,7 @@ export async function GetReadme( { fileId: data.files[0].id as string, alt: "media", + supportsAllDrives: config.apiConfig.isTeamDrive, }, { responseType: "text", diff --git a/src/app/api/download/[encryptedId]/route.ts b/src/app/api/download/[encryptedId]/route.ts index bba8c4e..2b6c2b0 100644 --- a/src/app/api/download/[encryptedId]/route.ts +++ b/src/app/api/download/[encryptedId]/route.ts @@ -1,4 +1,5 @@ import { NextRequest, NextResponse } from "next/server"; + import { CheckDownloadToken, CheckPassword,