Allow partial process config updates
This commit is contained in:
parent
c44fb30a84
commit
59aa6af767
1 changed files with 8 additions and 0 deletions
|
|
@ -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)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue