🎨 Refresh block updated time when updating task list item marker (#17529)

* 🐛 Refresh block updated time when updating task list item marker via API

* ♻️ Refactor task list item marker update operations for improved clarity and efficiency
This commit is contained in:
Jiacheng 2026-04-18 17:06:44 +08:00 committed by GitHub
parent 21ff9ecf5f
commit e9f92d2a06
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -73,6 +73,8 @@ func buildUpdatedTaskListItemBlockDOM(id, marker string, luteEngine *lute.Lute)
markerNode.TaskListItemMarker = liMarker
markerNode.TaskListItemChecked = ' ' != markerNode.TaskListItemMarker
li.SetIALAttr("updated", util.CurrentTimeSecondsStr())
return luteEngine.RenderNodeBlockDOM(li), nil
}
@ -107,11 +109,7 @@ func updateTaskListItemMarker(c *gin.Context) {
transactions := []*model.Transaction{
{
DoOperations: []*model.Operation{
{
Action: "update",
ID: id,
Data: data,
},
{Action: "update", ID: id, Data: data},
},
},
}
@ -172,11 +170,7 @@ func batchUpdateTaskListItemMarker(c *gin.Context) {
return
}
ops = append(ops, &model.Operation{
Action: "update",
ID: id,
Data: data,
})
ops = append(ops, &model.Operation{Action: "update", ID: id, Data: data})
}
tx := &model.Transaction{DoOperations: ops}