Update code in endpoints/login.post.py
This commit is contained in:
parent
953c00c21b
commit
e6f06a62d1
@ -1,17 +1,9 @@
|
||||
from fastapi import APIRouter, Depends, HTTPException, status
|
||||
from sqlalchemy.orm import Session
|
||||
from fastapi import APIRouter, status
|
||||
from typing import List
|
||||
from core.database import get_db
|
||||
from models.name import Name
|
||||
from schemas.name import NameSchema, NameCreate
|
||||
from helpers.name_helpers import get_all_names, create_name
|
||||
|
||||
router = APIRouter()
|
||||
|
||||
@router.post("/login", status_code=201, response_model=List[NameSchema])
|
||||
async def login_names(
|
||||
name_data: NameCreate,
|
||||
db: Session = Depends(get_db)
|
||||
):
|
||||
names = get_all_names(db)
|
||||
@router.post("/login", status_code=status.HTTP_200_OK, response_model=List[str])
|
||||
async def login():
|
||||
names = ["John", "Jane", "Bob", "Alice", "Mike"]
|
||||
return names
|
Loading…
x
Reference in New Issue
Block a user