Auto status change to "Under Review"
@@ -196,18 +196,29 void CatalogueController::discardEvent(std::shared_ptr<DBEvent> event) | |||||
196 | auto uniqIdPredicate = std::make_shared<ComparaisonPredicate>( |
|
196 | auto uniqIdPredicate = std::make_shared<ComparaisonPredicate>( | |
197 | QString{"uniqId"}, event->getUniqId(), ComparaisonOperation::EQUALEQUAL); |
|
197 | QString{"uniqId"}, event->getUniqId(), ComparaisonOperation::EQUALEQUAL); | |
198 |
|
198 | |||
199 |
auto |
|
199 | auto syncRepositoryPredicate = std::make_shared<ComparaisonPredicate>( | |
200 | QString{"repository"}, impl->toSyncRepository(event->getRepository()), |
|
200 | QString{"repository"}, impl->toSyncRepository(event->getRepository()), | |
201 | ComparaisonOperation::EQUALEQUAL); |
|
201 | ComparaisonOperation::EQUALEQUAL); | |
202 |
|
202 | |||
203 |
auto |
|
203 | auto syncPred = std::make_shared<CompoundPredicate>(CompoundOperation::AND); | |
204 |
|
|
204 | syncPred->AddRequestPredicate(uniqIdPredicate); | |
205 |
|
|
205 | syncPred->AddRequestPredicate(syncRepositoryPredicate); | |
206 |
|
206 | |||
207 |
|
207 | |||
208 | auto syncEvent = impl->m_CatalogueDao.getEvent(compCompoundPred); |
|
208 | auto workRepositoryPredicate = std::make_shared<ComparaisonPredicate>( | |
|
209 | QString{"repository"}, impl->toWorkRepository(event->getRepository()), | |||
|
210 | ComparaisonOperation::EQUALEQUAL); | |||
|
211 | ||||
|
212 | auto workPred = std::make_shared<CompoundPredicate>(CompoundOperation::AND); | |||
|
213 | workPred->AddRequestPredicate(uniqIdPredicate); | |||
|
214 | workPred->AddRequestPredicate(workRepositoryPredicate); | |||
|
215 | ||||
|
216 | ||||
|
217 | auto syncEvent = impl->m_CatalogueDao.getEvent(syncPred); | |||
209 | impl->m_CatalogueDao.copyEvent(syncEvent, impl->toWorkRepository(event->getRepository()), true); |
|
218 | impl->m_CatalogueDao.copyEvent(syncEvent, impl->toWorkRepository(event->getRepository()), true); | |
210 | *event = syncEvent; |
|
219 | ||
|
220 | auto workEvent = impl->m_CatalogueDao.getEvent(workPred); | |||
|
221 | *event = workEvent; | |||
211 | impl->m_EventKeysWithChanges.remove(impl->eventUniqueKey(event)); |
|
222 | impl->m_EventKeysWithChanges.remove(impl->eventUniqueKey(event)); | |
212 | } |
|
223 | } | |
213 |
|
224 |
General Comments 3
Status change > Approved
You need to be logged in to leave comments.
Login now