@@ -90,11 +90,11 @@ class GetAPICallback: Callback {
9090 internal func buildFieldsDict( dict: [ String : Any ] ) -> [ String : Any ] {
9191 var temp : [ String : Any ] = [ : ]
9292 for (key, val) in dict {
93- if let v = val as? [ String : Any ] {
94- temp [ key] = buildFieldsDict ( dict: v)
95- } else {
96- temp [ key] = val
97- }
93+ if let v = val as? [ String : Any ] {
94+ temp [ key] = buildFieldsDict ( dict: v)
95+ } else {
96+ temp [ key] = val
97+ }
9898 }
9999 return temp
100100 }
@@ -133,10 +133,13 @@ class GetAPICallback: Callback {
133133 urlComponents? . queryItems? . append ( URLQueryItem ( name: " skyflow_ids " , value: id) )
134134 }
135135 } else if record. columnValues != nil && record. columnName != nil {
136-
137- for columnValue in record. columnValues! {
138- urlComponents? . queryItems? . append ( URLQueryItem ( name: " column_name " , value: record. columnName) )
139- urlComponents? . queryItems? . append ( URLQueryItem ( name: " column_values " , value: columnValue) )
136+ if let array = record. columnValues {
137+ for (index, value) in array. enumerated ( ) {
138+ if index == 0 {
139+ urlComponents? . queryItems? . append ( URLQueryItem ( name: " column_name " , value: record. columnName) )
140+ }
141+ urlComponents? . queryItems? . append ( URLQueryItem ( name: " column_values " , value: value) )
142+ }
140143 }
141144 }
142145 if ( record. redaction != nil && getOptions. tokens == false ) {
@@ -186,6 +189,7 @@ class GetAPICallback: Callback {
186189 for entry in jsonDataArray {
187190 var entryDict = self . buildFieldsDict ( dict: entry)
188191 entryDict [ " table " ] = record. table
192+ entryDict. removeValue ( forKey: " tokens " )
189193 outputArray. append ( entryDict)
190194 }
191195 }
0 commit comments