From 96572c35b13c19ea9d56745560e3dc2cdd6ba04e Mon Sep 17 00:00:00 2001 From: Sonja Happ Date: Mon, 25 Oct 2021 11:02:38 +0200 Subject: [PATCH] allow widget name to be empty string in update --- routes/widget/widget_validators.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/routes/widget/widget_validators.go b/routes/widget/widget_validators.go index a3e4ce2..535bc01 100644 --- a/routes/widget/widget_validators.go +++ b/routes/widget/widget_validators.go @@ -103,11 +103,7 @@ func (r *addWidgetRequest) createWidget() Widget { func (r *updateWidgetRequest) updatedWidget(oldWidget Widget) Widget { // Use the old Widget as a basis for the updated Widget `s` s := oldWidget - - if r.Widget.Name != "" { - s.Name = r.Widget.Name - } - + s.Name = r.Widget.Name s.Type = r.Widget.Type s.Width = r.Widget.Width s.Height = r.Widget.Height