Refine api to support one batch command
This commit is contained in:
@@ -16,7 +16,7 @@ def get_curve(name: str, id: str) -> dict[str, Any]:
|
||||
return { 'id': id, 'coords': cs }
|
||||
|
||||
|
||||
def set_curve(name: str, cs: ChangeSet) -> ChangeSet:
|
||||
def set_curve_cache(name: str, cs: ChangeSet) -> SqlChangeSet:
|
||||
id = cs.operations[0]['id']
|
||||
|
||||
old = get_curve(name, id)
|
||||
@@ -46,4 +46,8 @@ def set_curve(name: str, cs: ChangeSet) -> ChangeSet:
|
||||
redo_cs = g_update_prefix | { 'type': 'curve' } | new
|
||||
undo_cs = g_update_prefix | { 'type': 'curve' } | old
|
||||
|
||||
return execute_command(name, redo_sql, undo_sql, redo_cs, undo_cs)
|
||||
return SqlChangeSet(redo_sql, undo_sql, redo_cs, undo_cs)
|
||||
|
||||
|
||||
def set_curve(name: str, cs: ChangeSet) -> ChangeSet:
|
||||
return execute_command(name, set_curve_cache(name, cs))
|
||||
|
||||
Reference in New Issue
Block a user