2017-10-31 2 views
1

私はidで顧客を削除したいが、エラーが出る。ヘルプnode.jsのidを使用している顧客を削除する

  app.get('/deleteCustomer/:customerID', function (req, res){ 

      var customerID = req.params.customerID; 

      customer.delete({ 
       where:{ 
        id:customerID 
       }, 
       include:[mealRequirement, user] 
      }).then(function(customers){ 
       //res.render('main.ejs', {page:"addCustomer", mrcats:mrcats, customer:customers[0], user:customers[0].user, authUser: req.isAuthenticated()}); 
      }); 

}); 

TypeError例外のためthnks:customer.deleteはObject.handle

+0

あなたはマングースを使用していますか? – JulianSoto

+0

あなたが破壊を使用してマングース除去のために続けるために –

答えて

0

あなたがsequelizeを使用している場合では関数ではありません、あなたの代わりに、削除のdestroyを使用する必要があります。

関連する問題