feat:(Packagers): post request sorted

This commit is contained in:
darkicewolf50 2024-11-30 14:03:31 -07:00
parent a0712e15eb
commit 207db735e7
5 changed files with 14 additions and 12 deletions

Binary file not shown.

View File

@ -1,6 +1,7 @@
import json
from fastapi import FastAPI
from fastapi.responses import JSONResponse
from pydantic import BaseModel
app = FastAPI()
@ -29,7 +30,7 @@ def get_root():
from GetSchedulePackager import getSchedulePackager
@app.get("/getSchedule")
def getSchedule():
async def getSchedule():
res = getSchedulePackager()
@ -46,10 +47,15 @@ def getSchedule():
from postSelectAppointment import SelectAppointment
@app.post("/SelectInterview")
def postSelectInterview(request):
class Appointment(BaseModel):
name: str
date: str
res = SelectAppointment(request)
@app.post("/SelectInterview")
async def postSelectInterview(rawRequest: dict):
res = SelectAppointment(rawRequest)
return JSONResponse(
headers={

View File

@ -17,20 +17,16 @@ def SelectAppointment (appointmentJson):
``Contact``: darkicewolf50@gmail.com
"""
print(appointmentJson)
status = mockWriteFunction(appointmentJson)
if status:
resBody = {"Success": True}
resBody = {"Success": True, "message": ""}
else:
resBody = {"Success": False}
resBody = {"Success": False, "message": ""}
return {
"statusCode": 200,
"isBase64ENcoded": "false",
"body": json.dumps(resBody)
}
resBody["message"] = appointmentJson["message"]
return resBody
def mockWriteFunction(appTime):
return 0