🎨 Rows non-bound in the database support Add to Database https://github.com/siyuan-note/siyuan/issues/11093

This commit is contained in:
Daniel 2024-04-20 12:14:45 +08:00
parent 0f06692da4
commit 24b7862262
No known key found for this signature in database
GPG key ID: 86211BA83DF03017

View file

@ -2165,7 +2165,16 @@ func setAttributeViewColumnCalc(operation *Operation) (err error) {
}
func (tx *Transaction) doInsertAttrViewBlock(operation *Operation) (ret *TxErr) {
err := AddAttributeViewBlock(tx, operation.Srcs, operation.AvID, operation.BlockID, operation.PreviousID, operation.IsDetached, operation.IgnoreFillFilterVal)
var srcs []map[string]interface{}
if 0 < len(operation.Srcs) {
srcs = operation.Srcs
} else {
for _, srcID := range operation.SrcIDs {
srcs = append(srcs, map[string]interface{}{"id": srcID})
}
}
err := AddAttributeViewBlock(tx, srcs, operation.AvID, operation.BlockID, operation.PreviousID, operation.IsDetached, operation.IgnoreFillFilterVal)
if nil != err {
return &TxErr{code: TxErrWriteAttributeView, id: operation.AvID, msg: err.Error()}
}