feat(14.2.1-06): hydrate relation-child update and show ML maps
UpdateChild and ShowChild now lift, apply, and hydrate nested locales the same way as host CRUD, so a child form keeps English on the column and Polish through the writer. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -290,7 +290,10 @@ func (s RelationService) ShowChild(ctx context.Context, cc *CompiledController,
|
||||
return err
|
||||
}
|
||||
result, err = projectFullRecord(ctx, tx, form, child)
|
||||
return err
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return hydrateMLRecord(ctx, tx, form, s.writer, child, result.Data, "update")
|
||||
})
|
||||
if err != nil {
|
||||
return RecordResult{}, err
|
||||
@@ -324,6 +327,10 @@ func (s RelationService) UpdateChild(ctx context.Context, cc *CompiledController
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
translations, err := liftMLValues(ctx, cr.child, in.Body, "update", s.writer, tx)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.fillChild(ctx, tx, cr.child, child, in.Body, "update"); err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -335,6 +342,9 @@ func (s RelationService) UpdateChild(ctx context.Context, cc *CompiledController
|
||||
if err := tx.WithContext(ctx).Save(child).Error; err != nil {
|
||||
return lifecycleFailure(cc, err)
|
||||
}
|
||||
if err := applyMLTranslations(ctx, tx, s.writer, child, translations); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.commitChildFiles(ctx, tx, cr, child, "update", in); err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -344,7 +354,10 @@ func (s RelationService) UpdateChild(ctx context.Context, cc *CompiledController
|
||||
}
|
||||
}
|
||||
result, err = projectFullRecord(ctx, tx, cr.child, child)
|
||||
return err
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return hydrateMLRecord(ctx, tx, cr.child, s.writer, child, result.Data, "update")
|
||||
})
|
||||
if err != nil {
|
||||
return RecordResult{}, err
|
||||
|
||||
Reference in New Issue
Block a user