From 5c3ecd040723c9c4e8d98aefebffbe840561eebd Mon Sep 17 00:00:00 2001 From: bbma <1051528468@qq.com> Date: Sun, 8 Oct 2023 15:43:55 +0800 Subject: [PATCH] =?UTF-8?q?Fixed=20an=20issue=20where=20categories=20were?= =?UTF-8?q?=20not=20updated=20in=20the=20App=20Store=20aft=E2=80=A6=20(#59?= =?UTF-8?q?25)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixed an issue where categories were not updated in the App Store after the app template was republished Signed-off-by: bingbing ma Co-authored-by: bingbing ma --- pkg/models/openpitrix/applicationversions.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/models/openpitrix/applicationversions.go b/pkg/models/openpitrix/applicationversions.go index 0d142e2a6..026672a4a 100644 --- a/pkg/models/openpitrix/applicationversions.go +++ b/pkg/models/openpitrix/applicationversions.go @@ -428,8 +428,9 @@ func (c *applicationOperator) DoAppVersionAction(versionId string, request *Acti return err } - if !reflect.DeepEqual(&app.Spec, &appInStore.Spec) { + if !reflect.DeepEqual(&app.Spec, &appInStore.Spec) || !reflect.DeepEqual(app.Labels[constants.CategoryIdLabelKey], appInStore.Labels[constants.CategoryIdLabelKey]) { appCopy := appInStore.DeepCopy() + appCopy.Labels[constants.CategoryIdLabelKey] = app.Labels[constants.CategoryIdLabelKey] appCopy.Spec = app.Spec patch := client.MergeFrom(appInStore) data, _ := patch.Data(appCopy)