takahe/api/views/apps.py
Andrew Godwin 8f57aa5f37
UI/Domains Refactor
Redoes the UI to remove timelines, promote domains, and a lot of other things to support the refactor.
2023-05-03 22:42:37 -06:00

22 lines
545 B
Python

from hatchway import QueryOrBody, api_view
from .. import schemas
from ..models import Application
@api_view.post
def add_app(
request,
client_name: QueryOrBody[str],
redirect_uris: QueryOrBody[str],
scopes: QueryOrBody[None | str] = None,
website: QueryOrBody[None | str] = None,
) -> schemas.Application:
application = Application.create(
client_name=client_name,
website=website,
redirect_uris=redirect_uris,
scopes=scopes,
)
return schemas.Application.from_orm(application)