forked from zelo72/mastodon-ios
fix: profile field edit update logic issue
This commit is contained in:
parent
26b48957cd
commit
3ed43a3575
|
@ -30,7 +30,6 @@ final class ProfileFieldView: UIView {
|
|||
textField.font = UIFontMetrics(forTextStyle: .headline).scaledFont(for: .systemFont(ofSize: 17, weight: .semibold), maximumPointSize: 20)
|
||||
textField.textColor = Asset.Colors.Label.primary.color
|
||||
textField.placeholder = L10n.Scene.Profile.Fields.Placeholder.label
|
||||
textField.isEnabled = false
|
||||
return textField
|
||||
}()
|
||||
|
||||
|
|
|
@ -217,10 +217,16 @@ extension Mastodon.API.Account {
|
|||
source.sensitive.flatMap { data.append(Data.multipart(key: "source[privacy]", value: $0)) }
|
||||
source.language.flatMap { data.append(Data.multipart(key: "source[privacy]", value: $0)) }
|
||||
}
|
||||
for (i, fieldsAttribute) in (fieldsAttributes ?? []).enumerated() {
|
||||
if let fieldsAttributes = fieldsAttributes {
|
||||
if fieldsAttributes.isEmpty {
|
||||
data.append(Data.multipart(key: "fields_attributes[]", value: ""))
|
||||
} else {
|
||||
for (i, fieldsAttribute) in fieldsAttributes.enumerated() {
|
||||
data.append(Data.multipart(key: "fields_attributes[\(i)][name]", value: fieldsAttribute.name))
|
||||
data.append(Data.multipart(key: "fields_attributes[\(i)][value]", value: fieldsAttribute.value))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
data.append(Data.multipartEnd())
|
||||
return data
|
||||
|
|
Loading…
Reference in New Issue