Use url_for to generate url for http functions on overview page

This commit is contained in:
Peter Stockings
2023-12-19 12:41:48 +11:00
parent c30c666caf
commit c968ef583c
2 changed files with 4 additions and 8 deletions

View File

@@ -1,13 +1,8 @@
def create_http_function_view_model(http_function):
# Base URL for the function invocation
base_url = "https://function.peterstockings.com/f/"
name = http_function['name']
function_view_model = {
"id": http_function['id'],
"name": name,
"name": http_function['name'],
"script_content": http_function['script_content'],
"url": f"{base_url}{name}",
"invoked_count": http_function['invoked_count'],
"environment_info": http_function['environment_info']
}