changes regarding td support

This commit is contained in:
loadingthedev
2023-09-25 20:26:03 +05:30
parent 904fa23307
commit 1c5e7c57f3
5 changed files with 5 additions and 3 deletions
+1
View File
@@ -47,6 +47,7 @@ export async function GET(request: NextRequest) {
{
fileId: path.passwordId as string,
alt: "media",
supportsAllDrives: gIndexConfig.apiConfig.isTeamDrive,
},
{ responseType: "text" },
)
@@ -20,6 +20,7 @@ export async function GET(request: NextRequest, { params }: { params: { encrypte
const fileContent = await gdrive.files.get({
fileId: lastId,
fields: "id, name, mimeType, parents",
supportsAllDrives: gIndexConfig.apiConfig.isTeamDrive,
});
if (fileContent) {
path.push(fileContent.data.name as string);
@@ -29,6 +30,7 @@ export async function GET(request: NextRequest, { params }: { params: { encrypte
const folderContent = await gdrive.files.get({
fileId: lastId,
fields: "id, name, mimeType, parents",
supportsAllDrives: gIndexConfig.apiConfig.isTeamDrive,
});
if (folderContent.data.id === gIndexConfig.apiConfig.rootFolder) {
lastId = "";
-1
View File
@@ -5,7 +5,6 @@ import getSearchParams from "utils/apiHelper/getSearchParams";
import { encryptData } from "utils/encryptionHelper/hash";
import ExtendedError from "utils/extendedError";
import { gdriveFilesList } from "utils/gdrive";
import gdrive from "utils/gdriveInstance";
import { IGDriveFiles } from "types/api/files";
import { APISearchResponse, ErrorResponse } from "types/api/response";
+1 -1
View File
@@ -39,7 +39,7 @@ const config: gIndexConfig = {
* You need to create a new folder and share it with the service account
* Then, copy the folder id and paste it here
*/
rootFolder: "",
rootFolder: "1KgPV6QB1GYT8fmn2uTfbtr9rDXqcRR0j",
isTeamDrive: false, // Set this to true if you're using Team Drive
defaultQuery: ["trashed = false", "(not mimeType contains 'google-apps' or mimeType contains 'folder')"],
defaultField:
+1 -1
View File
@@ -197,7 +197,7 @@ export async function getServerSideProps(context: GetServerSidePropsContext) {
const fetchRootId = gdrive.files.get({
fileId: gIndexConfig.apiConfig.rootFolder,
fields: "id",
supportsAllDrives: true,
supportsAllDrives: gIndexConfig.apiConfig.isTeamDrive,
});
const fetchPathId = path.map(async (path) => {
const query = ["trashed = false", `name = '${path}'`];