Cloud function assimilated


#1

only once after the deployment. I would like this to be assimilated,

const skygear =require ('skygear');

skygearCloud.afterSave('like', function(record, original, pool, options) {
  console.log("recod" + JSON.stringify(record));
  let pathologieId = record.pathologie_id._id;
  let pathologieIdWithoutPrefix= pathologieId.split('/')[1];
  if (!original) {
    pool.query(`UPDATE app_wangudoc."pathologie" SET like = like +1, _updated_at =CURRENT_TIMESTAMP WHERE _id='${pathologieIdWithoutPrefix}'`, function(err,result){
      if (err) {
        console.log(JSON.stringify(err));
        console.log(err);
        return ;
      }
      console.log(result);
      console.log(JSON.stringify(result))
    })
  }
  return ;
},{
  async:true
})```

#2

I had to deploy two functions but there is one that does not work, which are similar with my post


#3

Sorry not sure what is the questions…?