Signed-off-by: marinofaggiana <marino.faggiana@nextcloud.com>
This commit is contained in:
marinofaggiana 2022-08-24 10:41:07 +02:00
Родитель 37c292ddad
Коммит 421eec92da
1 изменённых файлов: 2 добавлений и 1 удалений

Просмотреть файл

@ -123,10 +123,11 @@ extension NCCommunication {
timeout: TimeInterval = 60,
completion: @escaping (NCCSearchResult?, _ errorCode: Int, _ errorDescription: String) -> Void) -> DataRequest? {
guard var endpoint = "ocs/v2.php/search/providers/\(id)/search?format=json&term=\(term)".urlEncoded else {
guard let term = term.urlEncoded else {
completion(nil, NSURLErrorBadURL, NSLocalizedString("_invalid_url_", value: "Invalid server url", comment: ""))
return nil
}
var endpoint = "ocs/v2.php/search/providers/\(id)/search?format=json&term=\(term)"
if let limit = limit {
endpoint += "&limit=\(limit)"
}