mirror of
https://github.com/cranci1/Sora.git
synced 2026-01-11 20:10:24 +00:00
add option for blank parameter
This commit is contained in:
parent
9addf8325c
commit
194be8ff2b
2 changed files with 10 additions and 2 deletions
Binary file not shown.
|
|
@ -174,7 +174,15 @@ struct SearchResultsView: View {
|
|||
guard let module = module, !searchText.isEmpty else { return }
|
||||
|
||||
let encodedSearchText = searchText.addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed) ?? searchText
|
||||
let urlString = "\(module.module[0].search.url)?\(module.module[0].search.parameter)=\(encodedSearchText)"
|
||||
let parameter = module.module[0].search.parameter
|
||||
let urlString: String
|
||||
|
||||
if parameter == "blank" {
|
||||
urlString = "\(module.module[0].search.url)\(encodedSearchText)"
|
||||
} else {
|
||||
urlString = "\(module.module[0].search.url)?\(parameter)=\(encodedSearchText)"
|
||||
}
|
||||
|
||||
guard let url = URL(string: urlString) else { return }
|
||||
|
||||
URLSession.custom.dataTask(with: url) { data, _, error in
|
||||
|
|
@ -215,4 +223,4 @@ struct SearchResultsView: View {
|
|||
}
|
||||
}.resume()
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue