Skip to content

Commit

Permalink
🎨 Add created and updated type column to database siyuan-note#9371
Browse files Browse the repository at this point in the history
  • Loading branch information
88250 committed Oct 9, 2023
1 parent faadbf5 commit 9028491
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions kernel/model/attribute_view.go
Original file line number Diff line number Diff line change
@@ -229,6 +229,23 @@ func RenderAttributeView(avID string) (viewable av.Viewable, attrView *av.Attrib

switch view.LayoutType {
case av.LayoutTypeTable:
// 列删除以后需要删除设置的过滤和排序
tmpFilters := []*av.ViewFilter{}
for _, f := range view.Table.Filters {
if k, _ := attrView.GetKey(f.Column); nil != k {
tmpFilters = append(tmpFilters, f)
}
}
view.Table.Filters = tmpFilters

tmpSorts := []*av.ViewSort{}
for _, s := range view.Table.Sorts {
if k, _ := attrView.GetKey(s.Column); nil != k {
tmpSorts = append(tmpSorts, s)
}
}
view.Table.Sorts = tmpSorts

viewable, err = renderAttributeViewTable(attrView, view)
}

0 comments on commit 9028491

Please sign in to comment.