Digital PCT265 defect CXTDT-531317: Give the default page type for those that send an empty string.

This commit is contained in:
Hedden, Kyle Matthew 2024-06-20 16:44:58 -04:00
parent 18aca32b43
commit 41548b8434

View File

@ -83,6 +83,9 @@ import Foundation
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
if let defaultPageType = Self.defaultPageType() {
pageType = try typeContainer.decodeIfPresent(String.self, forKey: .pageType) ?? defaultPageType
if pageType.isEmpty {
pageType = defaultPageType
}
} else {
pageType = try typeContainer.decode(String.self, forKey: .pageType)
}