From 17715d7bb3f823d42fb7509366418d74f408585b Mon Sep 17 00:00:00 2001 From: himeshr Date: Thu, 8 Feb 2024 12:15:29 +0530 Subject: [PATCH] #1290 | Fix merge over-written change and save individual as is --- packages/openchs-android/src/service/IndividualService.js | 5 +---- packages/openchs-android/src/service/MediaQueueService.js | 1 + 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/packages/openchs-android/src/service/IndividualService.js b/packages/openchs-android/src/service/IndividualService.js index 6fb09217d..147f97db7 100644 --- a/packages/openchs-android/src/service/IndividualService.js +++ b/packages/openchs-android/src/service/IndividualService.js @@ -109,10 +109,7 @@ class IndividualService extends BaseService { const db = this.db; this.db.write(() => { ObservationsHolder.convertObsForSave(individual.observations); - db.create(Individual.schema.name, { - uuid: individual.uuid, - observations: individual.observations - }, true); + db.create(Individual.schema.name, individual, true); db.create(EntityQueue.schema.name, EntityQueue.create(individual, Individual.schema.name)); }); } diff --git a/packages/openchs-android/src/service/MediaQueueService.js b/packages/openchs-android/src/service/MediaQueueService.js index 743aa0d7a..ea3b7c05c 100644 --- a/packages/openchs-android/src/service/MediaQueueService.js +++ b/packages/openchs-android/src/service/MediaQueueService.js @@ -201,6 +201,7 @@ class MediaQueueService extends BaseService { }) .then(() => this.uploadToUrl(uploadUrl, mediaQueueItem)) .then(() => this.replaceObservation(mediaQueueItem, uploadUrl)) + .then(() => this.popItem(mediaQueueItem)) .catch((error) => { General.logError("MediaQueueService", `Error while uploading ${mediaQueueItem.uuid} - ${mediaQueueItem.fileName}`); General.logError("MediaQueueService", error);