-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathviews.py
More file actions
27 lines (19 loc) · 1 KB
/
views.py
File metadata and controls
27 lines (19 loc) · 1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
from fastapi import APIRouter, Depends
from lnbits.core.views.generic import index, index_public
from lnbits.decorators import check_account_exists
from lnbits.helpers import template_renderer
chat_generic_router = APIRouter()
chat_public_router = APIRouter()
def chat_renderer():
return template_renderer(["chat/templates"])
chat_generic_router.add_api_route("/", methods=["GET"], endpoint=index, dependencies=[Depends(check_account_exists)])
chat_generic_router.add_api_route("/{categories_id}", methods=["GET"], endpoint=index_public)
chat_generic_router.add_api_route("/{categories_id}/{chat_id}", methods=["GET"], endpoint=index_public)
chat_generic_router.add_api_route("/embed/{categories_id}", methods=["GET"], endpoint=index_public)
chat_generic_router.add_api_route("/embed/{categories_id}/{chat_id}", methods=["GET"], endpoint=index_public)
chat_public_router.add_api_route(
"/chat/chats/{categories_id}",
methods=["GET"],
endpoint=index,
dependencies=[Depends(check_account_exists)],
)