Support partial updates

This commit is contained in:
Owen
2026-07-10 10:11:47 -04:00
parent 0b2693a317
commit f4bee6406a
@@ -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;