experimental homepage labels support

This commit is contained in:
yusing
2024-10-03 10:10:14 +08:00
parent 90bababd38
commit e6b4630ce9
7 changed files with 43 additions and 24 deletions

View File

@@ -58,7 +58,7 @@ func ApplyLabel[T any](obj *T, l *Label) E.NestedError {
}
dst, ok := field.Interface().(NestedLabelMap)
if !ok {
return E.Invalid("type", field.Type())
return U.Deserialize(U.SerializedObject{nestedLabel.Namespace: nestedLabel.Value}, field.Addr().Interface())
}
if dst == nil {
field.Set(reflect.MakeMap(reflect.TypeFor[NestedLabelMap]()))