@@ -64,8 +64,8 @@ protocol ZendeskManagerProtocol: SupportManagerAdapter {
64
64
func generalTags( ) -> [ String ]
65
65
func wcPayTags( ) -> [ String ]
66
66
67
- func generalCustomFields( ) -> [ [ Int64 : String ] ]
68
- func wcPayCustomFields( ) -> [ [ Int64 : String ] ]
67
+ func generalCustomFields( ) -> [ Int64 : String ]
68
+ func wcPayCustomFields( ) -> [ Int64 : String ]
69
69
}
70
70
71
71
struct NoZendeskManager : ZendeskManagerProtocol {
@@ -157,12 +157,12 @@ extension NoZendeskManager {
157
157
[ ]
158
158
}
159
159
160
- func generalCustomFields( ) -> [ [ Int64 : String ] ] {
161
- [ ]
160
+ func generalCustomFields( ) -> [ Int64 : String ] {
161
+ [ : ]
162
162
}
163
163
164
- func wcPayCustomFields( ) -> [ [ Int64 : String ] ] {
165
- [ ]
164
+ func wcPayCustomFields( ) -> [ Int64 : String ] {
165
+ [ : ]
166
166
}
167
167
}
168
168
@@ -555,19 +555,23 @@ extension ZendeskManager {
555
555
getWCPayTags ( supportSourceTag: nil )
556
556
}
557
557
558
- func generalCustomFields( ) -> [ [ Int64 : String ] ] {
558
+ func generalCustomFields( ) -> [ Int64 : String ] {
559
559
// Extracts the custom fields from the `createRequest` method
560
- createRequest ( supportSourceTag: nil ) . customFields. compactMap { field in
561
- guard let value = field. value as? String else { return nil } // Guards that all values are string
562
- return [ field. fieldId: value]
560
+ createRequest ( supportSourceTag: nil ) . customFields. reduce ( [ : ] ) { dict, field in
561
+ guard let value = field. value as? String else { return dict } // Guards that all values are string
562
+ var mutableDict = dict
563
+ mutableDict [ field. fieldId] = value
564
+ return mutableDict
563
565
}
564
566
}
565
567
566
- func wcPayCustomFields( ) -> [ [ Int64 : String ] ] {
568
+ func wcPayCustomFields( ) -> [ Int64 : String ] {
567
569
// Extracts the custom fields from the `createWCPayRequest` method.
568
- createWCPayRequest ( supportSourceTag: nil ) . customFields. compactMap { field in
569
- guard let value = field. value as? String else { return nil } // Guards that all values are string
570
- return [ field. fieldId: value]
570
+ createWCPayRequest ( supportSourceTag: nil ) . customFields. reduce ( [ : ] ) { dict, field in
571
+ guard let value = field. value as? String else { return dict } // Guards that all values are string
572
+ var mutableDict = dict
573
+ mutableDict [ field. fieldId] = value
574
+ return mutableDict
571
575
}
572
576
}
573
577
}
0 commit comments