From 59aa6af767084ec2abfdfce8420c95b3778b4e72 Mon Sep 17 00:00:00 2001 From: Ingo Oppermann Date: Mon, 2 Jan 2023 07:20:39 +0100 Subject: [PATCH] Allow partial process config updates --- http/handler/api/restream.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/http/handler/api/restream.go b/http/handler/api/restream.go index e585d0df..c61f363a 100644 --- a/http/handler/api/restream.go +++ b/http/handler/api/restream.go @@ -189,6 +189,14 @@ func (h *RestreamHandler) Update(c echo.Context) error { Autostart: true, } + current, err := h.restream.GetProcess(id) + if err != nil { + return api.Err(http.StatusNotFound, "Process not found", "%s", id) + } + + // Prefill the config with the current values + process.Unmarshal(current.Config) + if err := util.ShouldBindJSON(c, &process); err != nil { return api.Err(http.StatusBadRequest, "Invalid JSON", "%s", err) }