Reputation: 2255
How to move a file to trash using NodeJS and Google Drive API v3. Below lines are NOT working:
await drive.files.update({ fileId, trashed: true }); // not working
await drive.files.update({ fileId }, { trashed: true }); // not working
Upvotes: 3
Views: 904
Reputation: 201593
I believe your situation and goal as follows.
drive
can be used for using the method of "Files: update" of Drive API.For this, how about this modification? In this case, please include the request body to requestBody
or resource
as follows.
await drive.files.update({ fileId, requestBody: { trashed: true } });
or
await drive.files.update({ fileId, resource: { trashed: true } });
Upvotes: 4