-
Notifications
You must be signed in to change notification settings - Fork 82
Closed
Description
If I just send the actual model data all works well but if the model data you're trying to upsert contains related data the id's for the actual model don't change.
See UPDATE values in logs below.
BarType.upsert(barType)...
With related data in the model.
strong-remoting:shared-method - upsert - invoke with +0ms [
{
id: 7,
name: 'Belhaven',
barAccountTypeId: 1,
barAccountType: { id: 2, accountType: 'Independent' } /* related data */
},
[Function: callback] ]
loopback:connector:mysql SQL: INSERT INTO `bar_type`(`id`,`name`,`bar_account_type_id`) VALUES(?,?,?) ON DUPLICATE KEY UPDATE `name`=?,`bar_account_type_id`=?, params: [7,"Belhaven",2,"Belhaven",2] +1ms
Without related data in the model.
strong-remoting:shared-method - upsert - invoke with +0ms [
{
id: 7,
name: 'Belhaven',
barAccountTypeId: 1
},
[Function: callback] ]
loopback:connector:mysql SQL: INSERT INTO `bar_type`(`id`,`name`,`bar_account_type_id`) VALUES(?,?,?) ON DUPLICATE KEY UPDATE `name`=?,`bar_account_type_id`=?, params: [7,"Belhaven",1,"Belhaven",1] +0ms
Reactions are currently unavailable