From 18856f4217d27c69c6beca0cfb6eeb3eb4edd950 Mon Sep 17 00:00:00 2001 From: georgweiss Date: Fri, 6 Dec 2024 11:15:51 +0100 Subject: [PATCH] Edit olog entry called wrong endpoint --- .../olog/ui/write/LogEntryEditorController.java | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/app/logbook/olog/ui/src/main/java/org/phoebus/logbook/olog/ui/write/LogEntryEditorController.java b/app/logbook/olog/ui/src/main/java/org/phoebus/logbook/olog/ui/write/LogEntryEditorController.java index 7b3e59a63a..5950e3321a 100644 --- a/app/logbook/olog/ui/src/main/java/org/phoebus/logbook/olog/ui/write/LogEntryEditorController.java +++ b/app/logbook/olog/ui/src/main/java/org/phoebus/logbook/olog/ui/write/LogEntryEditorController.java @@ -599,16 +599,25 @@ public void submit() { if (editMode.equals(EditMode.NEW_LOG_ENTRY)) { ologLog.setAttachments(attachmentsEditorController.getAttachments()); } + else{ + ologLog.setId(logEntry.getId()); + } ologLog.setProperties(logPropertiesEditorController.getProperties()); LogClient logClient = logFactory.getLogClient(new SimpleAuthenticationToken(usernameProperty.get(), passwordProperty.get())); try { - if (replyTo == null) { - logEntryResult = Optional.of(logClient.set(ologLog)); - } else { - logEntryResult = Optional.of(logClient.reply(ologLog, replyTo)); + if(editMode.equals(EditMode.NEW_LOG_ENTRY)){ + if (replyTo == null) { + logEntryResult = Optional.of(logClient.set(ologLog)); + } else { + logEntryResult = Optional.of(logClient.reply(ologLog, replyTo)); + } + } + else{ + logEntryResult = Optional.of(logClient.update(ologLog)); } + // Not dirty anymore... isDirty = false;