Current items can be deleted by passing the UUID to the deleteItemFromServer signal.

This commit is contained in:
2026-02-02 16:15:20 +01:00
parent 63fe96fb2e
commit db1ecbece0
5 changed files with 39 additions and 2 deletions

View File

@ -168,6 +168,14 @@ void GenericCore::onPostRequestFailure(const QString errorString) {
emit displayStatusMessage(QString("Error: %1").arg(errorString));
}
void GenericCore::onDeleteRequestSuccessful(const QByteArray responseData) {
qWarning() << "TODO: Process success response!!!";
}
void GenericCore::onDeleteRequestFailure(const QString errorString) {
qWarning() << "TODO: Process error response!!!";
}
void GenericCore::setupModels() {
m_mainModel = make_shared<TableModel>(m_modelUndoStack, this);
m_sortFilterModel = make_shared<GeneralSortFilterModel>(m_mainModel);
@ -231,6 +239,8 @@ void GenericCore::setupServerConfiguration() {
connect(this, &GenericCore::fetchItemsFromServer, m_serverCommunicator.get(),
&ServerCommunicator::fetchItems);
connect(this, &GenericCore::postItemToServer, this, &GenericCore::onSendItemTriggered);
connect(this, &GenericCore::deleteItemFromServer, m_serverCommunicator.get(),
&ServerCommunicator::deleteItem);
/// response connections
connect(m_serverCommunicator.get(), &ServerCommunicator::itemsFetched, this,
@ -241,6 +251,10 @@ void GenericCore::setupServerConfiguration() {
&GenericCore::onPostRequestSuccessful);
connect(m_serverCommunicator.get(), &ServerCommunicator::postRequestFailure, this,
&GenericCore::onPostRequestFailure);
connect(m_serverCommunicator.get(), &ServerCommunicator::deleteRequestSuccessful, this,
&GenericCore::onDeleteRequestSuccessful);
connect(m_serverCommunicator.get(), &ServerCommunicator::deleteRequestFailure, this,
&GenericCore::onDeleteRequestFailure);
/// fetching/posting items on startup to test the communication with the server
// m_serverCommunicator->fetchItems();