You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have Order connected by HasMany relation with OrderItem, the insert method looks pretty good, but about update, I think its missing to create item if not exists
Imagine I created a new Order using insert with two OrderItem, so If I remove one OrderItem or maybe insert a new it won't be updated table OrderItem
if (cascade) {
Order newModel;
if (model.orderProducts != null) {
for (final child in model.orderProducts) {
await productBean.update(child,
cascade: cascade, associate: associate);
}
}
if (model.orderItems != null) {
if (associate) {
newModel ??= await find(model.id);
model.orderItems
.forEach((x) => orderItemBean.associateOrder(x, newModel));
}
for (final child in model.orderItems) {
await orderItemBean.update(child,
cascade: cascade, associate: associate);
}
}
}
The text was updated successfully, but these errors were encountered:
I have
Order
connected by HasMany relation withOrderItem
, the insert method looks pretty good, but about update, I think its missing to create item if not existsImagine I created a new
Order
using insert with twoOrderItem
, so If I remove one OrderItem or maybe insert a new it won't be updated tableOrderItem
The text was updated successfully, but these errors were encountered: