200331_TIL
try { a.b.c.d = f; } catch (e) { console.dir(e); // ReferenceError: a is not defined } // 에러인 e 객체 { message: 'a is not defined', stack: 'ReferenceError: a is not defined\n at <anonymous>:2:3', __proto__: Error }
AssertionError [ERR_ASSERTION]: Missing where attribute in the options parameter
--- postman으로 http://localhost:4000/card/hinted에
patch 요청 시 발생
=> update(values, options)
update 첫번째 매개변수인 values 주지 않아서 생긴 오류😓
https://sequelize.readthedocs.io/en/latest/api/model/#updatevalues-options-promisearrayaffectedcount-affectedrows
https://stackoverflow.com/questions/26581715/sequelize-update-does-not-work-anymore-missing-where-attribute-in-the-options
https://sequelize.org/master/class/lib/model.js~Model.html#static-method-update
https://stackoverflow.com/questions/50078137/warning-ignoring-ref-with-broken-name-refs-stash-2
let values = { marked: "1" };
// "1": true, "0": false
// (db에는 tinyint(1)로 저장)
let condition = { where: { id: req.body.id } };
Card.update(values, condition);