🐞 fix: Missing supportAllDrives when getting files

This commit is contained in:
mbaharip
2024-04-23 11:57:57 +07:00
parent a7bbbc0927
commit 5fb3c2ba0d
3 changed files with 6 additions and 0 deletions
+3
View File
@@ -11,6 +11,8 @@ import { decryptData } from "~/utils/encryptionHelper/hash";
import gdrive from "~/utils/gdriveInstance"; import gdrive from "~/utils/gdriveInstance";
import { getFileType } from "~/utils/previewHelper"; import { getFileType } from "~/utils/previewHelper";
import config from "~/config/gIndex.config";
import FileBrowser from "../@explorer"; import FileBrowser from "../@explorer";
import Header from "../@header"; import Header from "../@header";
import HeaderButton from "../@header.button"; import HeaderButton from "../@header.button";
@@ -102,6 +104,7 @@ export default async function RestPage({ params: { rest } }: Props) {
const { data: file } = await gdrive.files.get({ const { data: file } = await gdrive.files.get({
fileId: await decryptData(encryptedId), fileId: await decryptData(encryptedId),
fields: "mimeType, fileExtension", fields: "mimeType, fileExtension",
supportsAllDrives: config.apiConfig.isTeamDrive,
}); });
if (!file.mimeType?.includes("folder")) { if (!file.mimeType?.includes("folder")) {
promise.push(GetFile(encryptedId)); promise.push(GetFile(encryptedId));
+2
View File
@@ -258,6 +258,7 @@ export async function CheckPassword(
{ {
fileId: protectedFolder.id as string, fileId: protectedFolder.id as string,
alt: "media", alt: "media",
supportsAllDrives: config.apiConfig.isTeamDrive,
}, },
{ {
responseType: "text", responseType: "text",
@@ -637,6 +638,7 @@ export async function GetReadme(
{ {
fileId: data.files[0].id as string, fileId: data.files[0].id as string,
alt: "media", alt: "media",
supportsAllDrives: config.apiConfig.isTeamDrive,
}, },
{ {
responseType: "text", responseType: "text",
@@ -1,4 +1,5 @@
import { NextRequest, NextResponse } from "next/server"; import { NextRequest, NextResponse } from "next/server";
import { import {
CheckDownloadToken, CheckDownloadToken,
CheckPassword, CheckPassword,