Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

124
Views
Google Drive Api v3 in Javascript - Sharing files publicly collectively and waiting for the result of the requests

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

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!