mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-23 10:00:13 +01:00
♻️ Refactor av data structure
This commit is contained in:
parent
f123a9a210
commit
870c238ed6
2 changed files with 6 additions and 4 deletions
|
|
@ -85,6 +85,7 @@ type Value struct {
|
|||
ID string `json:"id"`
|
||||
KeyID string `json:"keyID"`
|
||||
BlockID string `json:"blockID"`
|
||||
Type KeyType `json:"type"`
|
||||
|
||||
Block *ValueBlock `json:"block,omitempty"`
|
||||
Text *ValueText `json:"text,omitempty"`
|
||||
|
|
|
|||
|
|
@ -694,12 +694,13 @@ func updateAttributeViewCell(operation *Operation, tx *Transaction) (err error)
|
|||
for _, value := range keyValues.Values {
|
||||
if operation.ID == value.ID {
|
||||
val = value
|
||||
val.Type = keyValues.Key.Type
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
if nil == val {
|
||||
val = &av.Value{ID: operation.ID, KeyID: keyValues.Key.ID, BlockID: operation.RowID}
|
||||
val = &av.Value{ID: operation.ID, KeyID: keyValues.Key.ID, BlockID: operation.RowID, Type: keyValues.Key.Type}
|
||||
keyValues.Values = append(keyValues.Values, val)
|
||||
}
|
||||
break
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue