Packaging a few small changes

* Make edit http function endpoint accept function id rather than name
* Move show alert js function to function editor template as its only used here
* Added a note that previous commit (API -> isolator request was changed from global routing to inter app routing) (It sped things up, but not its regressed; need to look into this further)
This commit is contained in:
Peter Stockings
2024-03-28 21:26:49 +11:00
parent df458c2738
commit 25178b5aad
4 changed files with 47 additions and 45 deletions

6
db.py
View File

@@ -69,10 +69,10 @@ class DataBase():
commit=True
)
def edit_http_function(self, user_id, name, updated_name, script_content, environment_info, is_public, log_request, log_response):
def edit_http_function(self, user_id, function_id, name, script_content, environment_info, is_public, log_request, log_response):
self.execute(
'UPDATE http_functions SET NAME=%s, script_content=%s, environment_info=%s, is_public=%s, log_request=%s, log_response=%s WHERE user_id=%s AND NAME=%s',
[updated_name, script_content, environment_info, is_public, log_request, log_response, user_id, name],
'UPDATE http_functions SET NAME=%s, script_content=%s, environment_info=%s, is_public=%s, log_request=%s, log_response=%s WHERE user_id=%s AND id=%s',
[name, script_content, environment_info, is_public, log_request, log_response, user_id, function_id],
commit=True
)