🎨 Improve adding rows of the filtered database table view https://github.com/siyuan-note/siyuan/issues/10025

This commit is contained in:
Daniel 2023-12-30 17:15:50 +08:00
parent 456feff45a
commit bab2a29498
No known key found for this signature in database
GPG key ID: 86211BA83DF03017

View file

@ -901,13 +901,19 @@ func updateAttributeViewColRollup(operation *Operation) (err error) {
KeyID: operation.KeyID,
}
data := operation.Data.(map[string]interface{})
calcData, err := gulu.JSON.MarshalJSON(data["calc"])
if nil != err {
return
}
if err = gulu.JSON.UnmarshalJSON(calcData, &rollUpKey.Rollup.Calc); nil != err {
return
if nil != operation.Data {
data := operation.Data.(map[string]interface{})
if nil != data["calc"] {
calcData, jsonErr := gulu.JSON.MarshalJSON(data["calc"])
if nil != jsonErr {
err = jsonErr
return
}
if jsonErr = gulu.JSON.UnmarshalJSON(calcData, &rollUpKey.Rollup.Calc); nil != jsonErr {
err = jsonErr
return
}
}
}
err = av.SaveAttributeView(attrView)