//SPDX-FileCopyrightText: 2023 Yury Gubich //SPDX-License-Identifier: GPL-3.0-or-later #include "currencies.h" #include "utils/helpers.h" Request::Currencies::Currencies (const QUrl& baseUrl): Request(createUrl(baseUrl, "/currencies")) {} void Request::Currencies::onSuccess (const QVariantMap& data) { QVariantMap::ConstIterator itr = data.find("currencies"); if (itr == data.constEnd() || !itr->canConvert()) return Request::onError("Error receiving currencies: currencies are missing or not in an array", std::nullopt); emit success(qast(itr.value())); emit done(); }