resullt all update knex mysql

Solutions on MaxInterview for resullt all update knex mysql by the best coders in the world

showing results for - "resullt all update knex mysql"
Alexia
05 Apr 2018
1const {id,name} = req.body;
2    const subQuery = knex('client').select('id').where({id})
3    subQuery.then(response=>{
4    if(response.length>0){
5        subQuery.update({name})
6        .then(resp=>{
7            res.json('update done')
8        })
9        .catch(err=>{res.json(err)})
10    }
11    else{
12        res.json('update failed')
13     }
14})
15.catch(err=>{res.json(err)})
16