From 91e6cd4466cfc178dc5b96db7eafee279094e5f2 Mon Sep 17 00:00:00 2001 From: Daniel <845765@qq.com> Date: Mon, 23 Oct 2023 11:38:27 +0800 Subject: [PATCH] :art: Update db table view --- kernel/model/attribute_view.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/kernel/model/attribute_view.go b/kernel/model/attribute_view.go index 5d31981dc34..c882827a7dc 100644 --- a/kernel/model/attribute_view.go +++ b/kernel/model/attribute_view.go @@ -167,8 +167,13 @@ func RenderAttributeView(avID string) (viewable av.Viewable, attrView *av.Attrib } if 1 > len(attrView.Views) { - err = av.ErrViewNotFound - return + view := av.NewView() + attrView.Views = append(attrView.Views, view) + attrView.ViewID = view.ID + if err = av.SaveAttributeView(attrView); nil != err { + logging.LogErrorf("save attribute view [%s] failed: %s", avID, err) + return + } } var view *av.View