mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-22 01:20:12 +01:00
🎨 Add Relation and Rollup column to database table view https://github.com/siyuan-note/siyuan/issues/9888
This commit is contained in:
parent
204398fa52
commit
dffcc2865b
1 changed files with 9 additions and 9 deletions
|
|
@ -785,17 +785,16 @@ func updateAttributeViewColRelation(operation *Operation) (err error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
destAdded := false
|
destAdded := false
|
||||||
for _, keyValues := range destAv.KeyValues {
|
backRelKey, _ := destAv.GetKey(operation.BackRelationKeyID)
|
||||||
if keyValues.Key.ID == operation.BackRelationKeyID {
|
if nil != backRelKey {
|
||||||
keyValues.Key.Relation = &av.Relation{
|
backRelKey.Relation = &av.Relation{
|
||||||
AvID: operation.AvID,
|
AvID: operation.AvID,
|
||||||
IsTwoWay: operation.IsTwoWay,
|
IsTwoWay: operation.IsTwoWay,
|
||||||
BackKeyID: operation.KeyID,
|
BackKeyID: operation.KeyID,
|
||||||
}
|
}
|
||||||
destAdded = true
|
destAdded = true
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if !destAdded {
|
if !destAdded {
|
||||||
destAv.KeyValues = append(destAv.KeyValues, &av.KeyValues{
|
destAv.KeyValues = append(destAv.KeyValues, &av.KeyValues{
|
||||||
Key: &av.Key{
|
Key: &av.Key{
|
||||||
|
|
@ -813,6 +812,7 @@ func updateAttributeViewColRelation(operation *Operation) (err error) {
|
||||||
}
|
}
|
||||||
if !isSameAv {
|
if !isSameAv {
|
||||||
err = av.SaveAttributeView(destAv)
|
err = av.SaveAttributeView(destAv)
|
||||||
|
util.BroadcastByType("protyle", "refreshAttributeView", 0, "", map[string]interface{}{"id": destAv.ID})
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue