mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-05-17 17:40:42 +08:00
🎨 Improve database attribute panel number field formating https://github.com/siyuan-note/siyuan/issues/12491
This commit is contained in:
parent
74d3302b09
commit
1e8133e9e5
@ -606,8 +606,16 @@ func setAttributeViewBlockAttr(c *gin.Context) {
|
|||||||
rowID := arg["rowID"].(string)
|
rowID := arg["rowID"].(string)
|
||||||
cellID := arg["cellID"].(string)
|
cellID := arg["cellID"].(string)
|
||||||
value := arg["value"].(interface{})
|
value := arg["value"].(interface{})
|
||||||
blockAttributeViewKeys := model.UpdateAttributeViewCell(nil, avID, keyID, rowID, cellID, value)
|
updatedVal, err := model.UpdateAttributeViewCell(nil, avID, keyID, rowID, cellID, value)
|
||||||
ret.Data = blockAttributeViewKeys
|
if err != nil {
|
||||||
|
ret.Code = -1
|
||||||
|
ret.Msg = err.Error()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
ret.Data = map[string]interface{}{
|
||||||
|
"value": updatedVal,
|
||||||
|
}
|
||||||
|
|
||||||
model.ReloadAttrView(avID)
|
model.ReloadAttrView(avID)
|
||||||
}
|
}
|
||||||
|
@ -2978,11 +2978,11 @@ func (tx *Transaction) doUpdateAttrViewCell(operation *Operation) (ret *TxErr) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func updateAttributeViewCell(operation *Operation, tx *Transaction) (err error) {
|
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
|
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)
|
attrView, err := av.ParseAttributeView(avID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
@ -3002,7 +3002,6 @@ func UpdateAttributeViewCell(tx *Transaction, avID, keyID, rowID, cellID string,
|
|||||||
}
|
}
|
||||||
|
|
||||||
now := time.Now().UnixMilli()
|
now := time.Now().UnixMilli()
|
||||||
var val *av.Value
|
|
||||||
oldIsDetached := true
|
oldIsDetached := true
|
||||||
if nil != blockVal {
|
if nil != blockVal {
|
||||||
oldIsDetached = blockVal.IsDetached
|
oldIsDetached = blockVal.IsDetached
|
||||||
|
Loading…
Reference in New Issue
Block a user