I am running the following using Google Drive API v3
const { result: { id: _spotDataFolderId } } = await drive.files.create({
resource: { name: 'SPOT_DATA', mimeType: 'application/vnd.google-apps.folder' }
});
const { result: { id: _patientsDataFolderId } } = await drive.files.create({
resource: { name: 'PATIENTS_DATA', mimeType: 'application/vnd.google-apps.folder' },
parents: [ _spotDataFolderId ]
});
I can see the first folder, SPOT_DATA
, getting created. However, within SPOT_DATA
, a file called Untitled
is getting created. How do I create a subfolder called PATIENTS_DATA
within SPOT_DATA
Note:
I am using async/await pattern. The SPOT_DATA
folder is getting created. Further, if I remove parents: [ _spotDataFolderId ]
from the second call, a folder PATIENTS_DATA
is getting created in the home dir of my Google drive.
How about this modification? In this modification, the property of parents
is included in resource
.
{
resource: { name: 'PATIENTS_DATA', mimeType: 'application/vnd.google-apps.folder' },
parents: [ _spotDataFolderId ]
}
{
resource: { name: 'PATIENTS_DATA', mimeType: 'application/vnd.google-apps.folder', parents: [ _spotDataFolderId ] },
}