macOS widgets
This commit is contained in:
parent
161fe8a773
commit
723321bd88
|
|
@ -175,7 +175,7 @@
|
||||||
<key>INIntentParameterMetadata</key>
|
<key>INIntentParameterMetadata</key>
|
||||||
<dict>
|
<dict>
|
||||||
<key>INIntentParameterMetadataDefaultValue</key>
|
<key>INIntentParameterMetadataDefaultValue</key>
|
||||||
<string>invoices</string>
|
<string>active_invoices</string>
|
||||||
</dict>
|
</dict>
|
||||||
<key>INIntentParameterName</key>
|
<key>INIntentParameterName</key>
|
||||||
<string>field</string>
|
<string>field</string>
|
||||||
|
|
|
||||||
|
|
@ -311,11 +311,7 @@ struct ApiService {
|
||||||
// process data
|
// process data
|
||||||
|
|
||||||
//print("## Details: \(String(describing: String(data: data, encoding: .utf8)))")
|
//print("## Details: \(String(describing: String(data: data, encoding: .utf8)))")
|
||||||
|
let result = try JSONDecoder().decode([String: ApiResult].self, from: data)
|
||||||
let result = try JSONDecoder().decode([String: ApiResult].self, from: ApiService.fixData(data: data))
|
|
||||||
|
|
||||||
//print("## Result: \(result)")
|
|
||||||
|
|
||||||
|
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
|
@ -325,17 +321,6 @@ struct ApiService {
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
static func fixData(data: Data) throws -> Data {
|
|
||||||
var dataString = String(data: data, encoding: .utf8)!
|
|
||||||
|
|
||||||
if let range = dataString.range(of: "\"currencies\":\\{[^\\}]*\\},", options: .regularExpression) {
|
|
||||||
dataString.removeSubrange(range)
|
|
||||||
}
|
|
||||||
|
|
||||||
return dataString.data(using: .utf8)!
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue