🎨 Improve database attribute panel number field formating https://github.com/siyuan-note/siyuan/issues/12491
This commit is contained in:
parent
74d3302b09
commit
1e8133e9e5
2 changed files with 12 additions and 5 deletions
|
@ -606,8 +606,16 @@ func setAttributeViewBlockAttr(c *gin.Context) {
|
|||
rowID := arg["rowID"].(string)
|
||||
cellID := arg["cellID"].(string)
|
||||
value := arg["value"].(interface{})
|
||||
blockAttributeViewKeys := model.UpdateAttributeViewCell(nil, avID, keyID, rowID, cellID, value)
|
||||
ret.Data = blockAttributeViewKeys
|
||||
updatedVal, err := model.UpdateAttributeViewCell(nil, avID, keyID, rowID, cellID, value)
|
||||
if err != nil {
|
||||
ret.Code = -1
|
||||
ret.Msg = err.Error()
|
||||
return
|
||||
}
|
||||
|
||||
ret.Data = map[string]interface{}{
|
||||
"value": updatedVal,
|
||||
}
|
||||
|
||||
model.ReloadAttrView(avID)
|
||||
}
|
||||
|
|
|
@ -2978,11 +2978,11 @@ func (tx *Transaction) doUpdateAttrViewCell(operation *Operation) (ret *TxErr) {
|
|||
}
|
||||
|
||||
func updateAttributeViewCell(operation *Operation, tx *Transaction) (err error) {
|
||||
err = UpdateAttributeViewCell(tx, operation.AvID, operation.KeyID, operation.RowID, operation.ID, operation.Data)
|
||||
_, err = UpdateAttributeViewCell(tx, operation.AvID, operation.KeyID, operation.RowID, operation.ID, operation.Data)
|
||||
return
|
||||
}
|
||||
|
||||
func UpdateAttributeViewCell(tx *Transaction, avID, keyID, rowID, cellID string, valueData interface{}) (err error) {
|
||||
func UpdateAttributeViewCell(tx *Transaction, avID, keyID, rowID, cellID string, valueData interface{}) (val *av.Value, err error) {
|
||||
attrView, err := av.ParseAttributeView(avID)
|
||||
if err != nil {
|
||||
return
|
||||
|
@ -3002,7 +3002,6 @@ func UpdateAttributeViewCell(tx *Transaction, avID, keyID, rowID, cellID string,
|
|||
}
|
||||
|
||||
now := time.Now().UnixMilli()
|
||||
var val *av.Value
|
||||
oldIsDetached := true
|
||||
if nil != blockVal {
|
||||
oldIsDetached = blockVal.IsDetached
|
||||
|
|
Loading…
Add table
Reference in a new issue