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

@ -142,16 +142,15 @@ bool GenericCore::isSyncServerSetup() const {
}
}
void GenericCore::onSendItemTriggered(const int row) {
// NEXT gather item values from model to send to server
m_serverCommunicator->postItems();
void GenericCore::onSendItemTriggered(const QByteArray& jsonData) {
m_serverCommunicator->postItems(jsonData);
}
void GenericCore::onItemsFetched(const QByteArray jsonDoc) {
void GenericCore::onItemsFetched(const QByteArray jsonData) {
emit displayStatusMessage("New items fetched.");
// TODO ? check compability of JSON structure beforehand?
// TODO check if item already exists?
m_mainModel->appendItems(jsonDoc);
m_mainModel->appendItems(jsonData);
}
void GenericCore::onItemsFetchFailure(const QString errorString) {