Update code in endpoints/logout.post.py
This commit is contained in:
parent
e0e1785bf7
commit
3305435dce
@ -1,10 +1,10 @@
|
|||||||
from fastapi import APIRouter, HTTPException
|
from fastapi import APIRouter, HTTPException
|
||||||
|
|
||||||
laptops = [
|
laptops = [
|
||||||
{"name": "Dell XPS 13"},
|
{"name": "Dell XPS 15"},
|
||||||
|
{"name": "MacBook Pro 16"},
|
||||||
{"name": "Lenovo ThinkPad X1 Carbon"},
|
{"name": "Lenovo ThinkPad X1 Carbon"},
|
||||||
{"name": "HP Spectre x360"},
|
{"name": "HP Spectre x360"},
|
||||||
{"name": "Apple MacBook Pro"},
|
|
||||||
{"name": "Asus ZenBook Pro Duo"}
|
{"name": "Asus ZenBook Pro Duo"}
|
||||||
]
|
]
|
||||||
|
|
||||||
@ -12,7 +12,7 @@ router = APIRouter()
|
|||||||
|
|
||||||
@router.post("/logout")
|
@router.post("/logout")
|
||||||
async def logout():
|
async def logout():
|
||||||
"""Returns list of laptop names"""
|
"""Endpoint that returns list of laptop names"""
|
||||||
if request.method != "POST":
|
if request.method != "POST":
|
||||||
raise HTTPException(status_code=405, detail="Method Not Allowed")
|
raise HTTPException(status_code=405, detail="Method Not Allowed")
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user