Skip to content

Commit 2938298

Browse files
authored
Add support for all drives
Fixes not found errors with shared drives
1 parent 402dfcf commit 2938298

File tree

1 file changed

+1
-1
lines changed
  • google-apps-script/drive-lock

1 file changed

+1
-1
lines changed

google-apps-script/drive-lock/code.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
const makeFileReadyOnly = () => {
99
const fileUrl = "https://docs.google.com/document/d/.....";
1010
const [fileId] = fileUrl.split("/").filter((e) => /[_-\w]{25,}/.test(e));
11-
UrlFetchApp.fetch(`https://www.googleapis.com/drive/v3/files/${fileId}`, {
11+
UrlFetchApp.fetch(`https://www.googleapis.com/drive/v3/files/${fileId}?supportsAllDrives=true`, {
1212
method: "PATCH",
1313
contentType: "application/json",
1414
headers: {

0 commit comments

Comments
 (0)