From 0e45c8e8256e73a8dcdf7e237a0d1eb561c73097 Mon Sep 17 00:00:00 2001 From: "WQY\\qiong" Date: Fri, 4 Nov 2022 22:49:41 +0800 Subject: [PATCH] Update curve sql --- api/s12_curves.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/s12_curves.py b/api/s12_curves.py index d20f1ec..eb8010d 100644 --- a/api/s12_curves.py +++ b/api/s12_curves.py @@ -75,7 +75,7 @@ def add_curve_cache(name: str, cs: ChangeSet) -> SqlChangeSet: new_f_type = f"'{new['c_type']}'" # TODO: transaction ? - redo_sql = f"\ninsert into _curve (id, type) values ({f_id}, {new_f_type});" + redo_sql = f"insert into _curve (id, type) values ({f_id}, {new_f_type});" for xy in cs.operations[0]['coords']: x, y = float(xy['x']), float(xy['y']) f_x, f_y = x, y @@ -106,7 +106,7 @@ def delete_curve_cache(name: str, cs: ChangeSet) -> SqlChangeSet: redo_sql += f"\ndelete from _curve where id = {f_id};" # TODO: transaction ? - undo_sql = f"\ninsert into _curve (id, type) values ({f_id}, {old_f_type});" + undo_sql = f"insert into _curve (id, type) values ({f_id}, {old_f_type});" for xy in old['coords']: f_x, f_y = xy['x'], xy['y'] undo_sql += f"\ninsert into curves (id, x, y) values ({f_id}, {f_x}, {f_y});"