Retrieving the JSON data of the current index to send to the server through the proxy model. Sending this data happens by triggering the core.

This commit is contained in:
2026-01-29 13:13:32 +01:00
parent 2a152daa70
commit bedf8084d3
9 changed files with 34 additions and 25 deletions

View File

@ -60,20 +60,7 @@ void ServerCommunicator::fetchItems() {
});
}
void ServerCommunicator::postItems() {
QJsonObject itemObject;
itemObject["name"] = "Post test 1";
itemObject["description"] = "Post description 1";
itemObject["info"] = "Post info 1";
itemObject["amount"] = 1;
itemObject["factor"] = 5.3;
QJsonObject rootObject;
rootObject.insert("item", itemObject);
QJsonDocument jsonDoc(rootObject);
QByteArray jsonData = jsonDoc.toJson();
void ServerCommunicator::postItems(const QByteArray& jsonData) {
QNetworkReply* reply = m_restManager->post(m_serviceApi->createRequest(ROUTE_ITEMS), jsonData);
QObject::connect(reply, &QNetworkReply::finished, [=]() {