feat(14.2.1-06): persist nested ML maps on relation-child create
RelationService looks up TranslationWriter like CRUDService so CreateChild can lift locale maps before fillChild, write Polish after the child PK, and return a hydrated title map. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -80,11 +80,11 @@ func (w *recordingWriter) EnabledLocales(context.Context, *gorm.DB) ([]string, e
|
||||
}
|
||||
|
||||
func (w *recordingWriter) WriteTranslated(_ context.Context, _ *gorm.DB, model any, field, locale, value string) error {
|
||||
post, _ := model.(*mlPost)
|
||||
if post == nil || post.ID == 0 {
|
||||
id := pkUint(model)
|
||||
if id == 0 {
|
||||
return &ValidationError{Details: map[string]any{field: []string{"translation writer ran before the host row had an id"}}}
|
||||
}
|
||||
w.ids = append(w.ids, post.ID)
|
||||
w.ids = append(w.ids, id)
|
||||
if w.attrs == nil {
|
||||
w.attrs = map[string]map[string]string{}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user