From e7424c811cbf125c0e77320dcec79914d51bda1c Mon Sep 17 00:00:00 2001 From: Andrea Cavalli Date: Sat, 27 Nov 2021 01:04:12 +0100 Subject: [PATCH] Update non-null fields --- .../src/main/java/io/volvox/chats/ChatService.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/service-chats/src/main/java/io/volvox/chats/ChatService.java b/service-chats/src/main/java/io/volvox/chats/ChatService.java index 5956b97..e7cbc25 100644 --- a/service-chats/src/main/java/io/volvox/chats/ChatService.java +++ b/service-chats/src/main/java/io/volvox/chats/ChatService.java @@ -89,7 +89,15 @@ public class ChatService { .replaceWith(chat); } else { // Update all fields - entity.name = chat.name; + if (chat.name != null) { + entity.name = chat.name; + } + if (chat.username != null) { + entity.username = chat.username; + } + if (chat.status != null) { + entity.status = chat.status; + } // Return the updated item return Uni.createFrom().item(entity); }