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:
Jakub Zych
2026-10-06 15:53:24 +02:00
parent 88a3a88876
commit 4e37d877f1
4 changed files with 49 additions and 6 deletions

View File

@@ -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