Add more checking for link api

This commit is contained in:
wqy
2022-09-17 22:26:03 +08:00
parent 5dd83d7652
commit 939cef4f1e
3 changed files with 9 additions and 0 deletions

View File

@@ -9,6 +9,8 @@ def add_pump(name: str, id: str, node1: str, node2: str) -> ChangeSet:
return ChangeSet()
if not is_node(name, node2):
return ChangeSet()
if node1 == node2:
return ChangeSet()
sql = f"insert into pumps (id, node1, node2) values ('{id}', '{node1}', '{node2}'');"
undo_sql = f'delete from pumps where id = "{id}";'