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

130
Visualizações
Best way to get info from Parse.com Cloud Code (Javascript SDK)

I’ve been looking on parse documentations but I’m a bit confused. I’ve been though this tutorial where it says I should make my backend operations though Cloud Code.

For my user profile Cloud Code I have the following:

Parse.Cloud.define("getUserInfo",async(request) => {
  let currentUser = request.user;
  let query = new Parse.Query("User");
  query.equalTo("objectId",currentUser.id)  
  let results = await query.find({useMasterKey:true});
  if(results.length === 0) throw new Error('No results found!');  
  let user = results[0];  
  let userInfo = [];
  userInfo.push(
   {
     Location:user.get("location"),
     Bio:user.get("bio")
   });
   return userInfo;
});

And in the client side (I’m using Angular):

let response = Parse.Cloud.run('getUserInfo');
console.log(response);

I’m not sure how to read the response in the promise. And right now I’m not even sure this is the best way to do it and I really haven’t found what I’m looking for on the web. So I would greatly appreciate some help on this.

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Something like this should work for you:

(async () => {
  const response = await Parse.Cloud.run('getUserInfo');
  console.log(response);
})();
about 4 years ago · Juan Pablo Isaza Relatório
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