diff --git a/MVMCoreUI/Atomic/Atoms/FormFields/FormFieldModel.swift b/MVMCoreUI/Atomic/Atoms/FormFields/FormFieldModel.swift index c96a8266..6bf8c0be 100644 --- a/MVMCoreUI/Atomic/Atoms/FormFields/FormFieldModel.swift +++ b/MVMCoreUI/Atomic/Atoms/FormFields/FormFieldModel.swift @@ -23,7 +23,7 @@ import VDS public var enabled: Bool = true public var required: Bool = true public var readOnly: Bool = false - public var showError: Bool? + public var showError: Bool = false public var errorMessage: String? public var initialErrorMessage: String? @@ -66,6 +66,7 @@ import VDS case moleculeName case accessibilityIdentifier case errorMessage + case showError case enabled case readOnly case required @@ -107,6 +108,7 @@ import VDS accessibilityIdentifier = try typeContainer.decodeIfPresent(String.self, forKey: .accessibilityIdentifier) errorMessage = try typeContainer.decodeIfPresent(String.self, forKey: .errorMessage) initialErrorMessage = errorMessage + showError = try typeContainer.decodeIfPresent(Bool.self, forKey: .showError) ?? false enabled = try typeContainer.decodeIfPresent(Bool.self, forKey: .enabled) ?? true required = try typeContainer.decodeIfPresent(Bool.self, forKey: .required) ?? true readOnly = try typeContainer.decodeIfPresent(Bool.self, forKey: .readOnly) ?? false @@ -126,6 +128,7 @@ import VDS try container.encodeIfPresent(errorMessage, forKey: .errorMessage) try container.encodeIfPresent(fieldKey, forKey: .fieldKey) try container.encodeIfPresent(groupName, forKey: .groupName) + try container.encode(showError, forKey: .showError) try container.encode(readOnly, forKey: .readOnly) try container.encode(enabled, forKey: .enabled) try container.encode(required, forKey: .required)