Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

118
Visualizações
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
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda