mirror of
https://github.com/datarhei/core.git
synced 2025-10-05 07:57:13 +08:00
Allow partial process config updates
This commit is contained in:
@@ -189,6 +189,14 @@ func (h *RestreamHandler) Update(c echo.Context) error {
|
|||||||
Autostart: true,
|
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 {
|
if err := util.ShouldBindJSON(c, &process); err != nil {
|
||||||
return api.Err(http.StatusBadRequest, "Invalid JSON", "%s", err)
|
return api.Err(http.StatusBadRequest, "Invalid JSON", "%s", err)
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user