Delete specific row after wixData.query

@aeroengineerz7
Hi Juan


  wixData.query("ReviewsPermission")
 .eq("_owner", userId)
 .find()
 .then( (result) => {
 if (result.items.length > 0) {
 let ownerId = result.items[0]._id;
 
   wixData.remove("ReviewsPermission", ownerId)
   .then( (results) => {
 let item = results;
   console.log("good");
   })
   .catch ((err)=>{
 let errorMsg = err;
    console.log(errorMsg);
  }); 
}
  else { 
     console.log("nothing");
   }
  })
  .catch ((err)=>{
 let errorMsg = err;
    console.log(errorMsg);
  }); 

Copy this code and go to preview.
Click the respective button.
Check the console and see what you get !!