Update non-null fields
This commit is contained in:
parent
2922c7b34a
commit
e7424c811c
|
@ -89,7 +89,15 @@ public class ChatService {
|
||||||
.replaceWith(chat);
|
.replaceWith(chat);
|
||||||
} else {
|
} else {
|
||||||
// Update all fields
|
// Update all fields
|
||||||
|
if (chat.name != null) {
|
||||||
entity.name = chat.name;
|
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 the updated item
|
||||||
return Uni.createFrom().item(entity);
|
return Uni.createFrom().item(entity);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue