mirror of
https://github.com/Nezumi-2711/next-gdrive-index.git
synced 2026-09-22 20:01:36 +00:00
🐞 fix: Missing supportAllDrives when getting files
This commit is contained in:
@@ -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));
|
||||||
|
|||||||
@@ -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,
|
||||||
|
|||||||
Reference in New Issue
Block a user