mirror of
https://github.com/fosrl/pangolin.git
synced 2026-07-13 17:21:48 +02:00
Support partial updates
This commit is contained in:
@@ -152,6 +152,11 @@ const updateSiteResourceSchema = z
|
|||||||
)
|
)
|
||||||
.refine(
|
.refine(
|
||||||
(data) => {
|
(data) => {
|
||||||
|
// this is a partial update; only enforce destination when the
|
||||||
|
// caller is actually changing mode or destination
|
||||||
|
if (data.mode === undefined && data.destination === undefined) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
// destination is only optional for ssh mode with native authDaemonMode
|
// destination is only optional for ssh mode with native authDaemonMode
|
||||||
if (data.mode === "ssh" && data.authDaemonMode === "native") {
|
if (data.mode === "ssh" && data.authDaemonMode === "native") {
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
Reference in New Issue
Block a user