mirror of
https://github.com/penxio/penx.git
synced 2026-01-13 07:27:57 -05:00
16 lines
624 B
TypeScript
16 lines
624 B
TypeScript
import { GOOGLE_DRIVE_FOLDER_PREFIX } from '@penx/constants'
|
|
import { GoogleDrive } from './google-drive'
|
|
|
|
export async function uploadToGoogleDrive(fileHash: string, file: File) {
|
|
// const token = await api.google.googleDriveToken.query()
|
|
// if (!token?.access_token) return
|
|
// const drive = new GoogleDrive(token?.access_token!)
|
|
// const baseFolderId = await drive.getOrCreateFolder(
|
|
// GOOGLE_DRIVE_FOLDER_PREFIX + spaceId + '-assets',
|
|
// )
|
|
// let files = await drive.searchFilesByPath(baseFolderId, fileHash)
|
|
// if (!files.length) {
|
|
// await drive.createFile(fileHash, file, baseFolderId)
|
|
// }
|
|
}
|