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

View File

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