From 6f4d31ceaf72ed0c63f4b3871778b178521a92ae Mon Sep 17 00:00:00 2001 From: Vlad Stan Date: Wed, 13 Nov 2024 10:43:15 +0200 Subject: [PATCH] feat: return `v1` data --- templates/example/index.html | 2 +- views_api.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/templates/example/index.html b/templates/example/index.html index b0997a9..76aa13f 100644 --- a/templates/example/index.html +++ b/templates/example/index.html @@ -1,7 +1,7 @@ {% extends "base.html" %} {% from "macros.jinja" import window_vars with context %} {% block scripts %} {{ window_vars(user) }} - + {% endblock %} {% block page %} diff --git a/views_api.py b/views_api.py index 22ac107..d90ca72 100644 --- a/views_api.py +++ b/views_api.py @@ -15,14 +15,14 @@ @example_ext_api.get("/test/{example_data}", description="Example API endpoint") -async def api_example(example_data: str) -> list[Example]: +async def api_example(example_data: str) -> Example: if example_data != "00000000": raise HTTPException( status_code=HTTPStatus.BAD_REQUEST, detail="Invalid example data", ) # Do some python things and return the data - return [Example(id="1", wallet=example_data), Example(id="2", wallet=example_data)] + return Example(id="1", wallet=example_data) @example_ext_api.get(