I have such a function to make the permission of the files publicly available before sharing the selected files.
generateFilesPublicly(ids) {
ids.forEach(id => {
drive.permissions.create({
'fileId': id,
'resource': {
'value': 'default',
'type': 'anyone',
'role': 'reader'
}
}).execute();
});
}
After completing these function requests, I need to call the next function to share files. My function to share files should wait for the process to be completed here. But how can I do that? How can I use the promise structure here? And does this function work properly?
What I need;
await generateFilesPublicly(ids);
... next functions