1 | |
2 |
|
3 | type Gdrive = { |
4 | token: string; |
5 | }; |
6 | export async function main(gdrive_auth: Gdrive, fileId: string) { |
7 | const supportsAllDrives = true; |
8 | const DELETE_FILE_URL = `https://www.googleapis.com/drive/v2/files/${fileId}/?supportsAllDrives=${supportsAllDrives}`; |
9 |
|
10 | const token = gdrive_auth["token"]; |
11 |
|
12 | const response = await fetch(DELETE_FILE_URL, { |
13 | method: "DELETE", |
14 | headers: { |
15 | Authorization: "Bearer " + token, |
16 | "Content-Type": "application/json", |
17 | }, |
18 | }); |
19 |
|
20 | return "file moved to trash"; |
21 | } |
22 |
|