From 3e062aed360ca54c26733b175d00d0d4671f3591 Mon Sep 17 00:00:00 2001 From: Andrew Godwin Date: Sun, 11 Dec 2022 00:25:48 -0700 Subject: Timelines working --- api/views/apps.py | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) (limited to 'api/views/apps.py') diff --git a/api/views/apps.py b/api/views/apps.py index 33ecf0f..1642ee9 100644 --- a/api/views/apps.py +++ b/api/views/apps.py @@ -1,7 +1,8 @@ import secrets -from ninja import Field, Schema +from ninja import Schema +from .. import schemas from ..models import Application from .base import api @@ -13,16 +14,7 @@ class CreateApplicationSchema(Schema): website: None | str = None -class ApplicationSchema(Schema): - id: str - name: str - website: str | None - client_id: str - client_secret: str - redirect_uri: str = Field(alias="redirect_uris") - - -@api.post("/v1/apps", response=ApplicationSchema) +@api.post("/v1/apps", response=schemas.Application) def add_app(request, details: CreateApplicationSchema): client_id = "tk-" + secrets.token_urlsafe(16) client_secret = secrets.token_urlsafe(40) -- cgit v1.2.3