Update non-null fields

This commit is contained in:
Andrea Cavalli 2021-11-27 01:04:12 +01:00
parent 2922c7b34a
commit e7424c811c

View File

@ -89,7 +89,15 @@ public class ChatService {
.replaceWith(chat);
} else {
// Update all fields
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);
}