forked from yaso_meth/mih-project
update fastapi to guvicorn and improve supertoken integration
This commit is contained in:
@@ -1,6 +1,32 @@
|
||||
FROM python:3.12-slim
|
||||
FROM tiangolo/uvicorn-gunicorn-fastapi:python3.11-slim AS builder
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY ./requirements.txt ./
|
||||
RUN pip3 install --no-cache-dir -r requirements.txt
|
||||
COPY requirements.txt ./
|
||||
RUN --mount=type=cache,target=/root/.cache/pip \
|
||||
pip install -r requirements.txt
|
||||
|
||||
# COPY . ./app
|
||||
|
||||
# FROM builder as dev-envs
|
||||
|
||||
# RUN <<EOF
|
||||
# apt-get update
|
||||
# apt-get install -y --no-install-recommends git
|
||||
# EOF
|
||||
|
||||
# RUN <<EOF
|
||||
# useradd -s /bin/bash -m vscode
|
||||
# groupadd docker
|
||||
# usermod -aG docker vscode
|
||||
# EOF
|
||||
# # install Docker tools (cli, buildx, compose)
|
||||
# COPY --from=gloursdocker/docker / /
|
||||
|
||||
# FROM python:3.12-slim
|
||||
|
||||
# WORKDIR /app
|
||||
|
||||
# COPY ./requirements.txt ./
|
||||
|
||||
# RUN pip3 install --no-cache-dir -r requirements.txt
|
||||
@@ -1,27 +1,28 @@
|
||||
from supertokens_python import init, InputAppInfo, SupertokensConfig
|
||||
from supertokens_python.recipe import emailpassword, session, dashboard
|
||||
# from supertokens_python import init, InputAppInfo, SupertokensConfig
|
||||
# from supertokens_python.recipe import emailpassword, session, dashboard
|
||||
|
||||
init(
|
||||
app_info=InputAppInfo(
|
||||
app_name="MIH_API_HUB",
|
||||
api_domain="http://localhost:8080/",
|
||||
website_domain="http://mzansi-innovation-hub.co.za",
|
||||
api_base_path="/auth",
|
||||
website_base_path="/auth"
|
||||
),
|
||||
supertokens_config=SupertokensConfig(
|
||||
# https://try.supertokens.com is for demo purposes. Replace this with the address of your core instance (sign up on supertokens.com), or self host a core.
|
||||
connection_uri="http://MIH-SuperTokens:3567/",
|
||||
api_key="leatucczyixqwkqqdrhayiwzeofkltds"
|
||||
),
|
||||
framework='fastapi',
|
||||
recipe_list=[
|
||||
session.init(), # initializes session features
|
||||
emailpassword.init(),
|
||||
dashboard.init(admins=[
|
||||
"yasienmeth@gmail.com",
|
||||
],
|
||||
)
|
||||
],
|
||||
mode='asgi' # use wsgi if you are running using gunicorn
|
||||
)
|
||||
# init(
|
||||
# app_info=InputAppInfo(
|
||||
# app_name="MIH_API_HUB",
|
||||
# api_domain="http://localhost:8080/",
|
||||
# website_domain="http://mzansi-innovation-hub.co.za",
|
||||
# api_base_path="/auth",
|
||||
# website_base_path="/auth"
|
||||
# ),
|
||||
# supertokens_config=SupertokensConfig(
|
||||
# # https://try.supertokens.com is for demo purposes. Replace this with the address of your core instance (sign up on supertokens.com), or self host a core.
|
||||
# connection_uri="supertokens:3567/",
|
||||
# api_key="leatucczyixqwkqqdrhayiwzeofkltds"
|
||||
# ),
|
||||
# framework='fastapi',
|
||||
# recipe_list=[
|
||||
# # SuperTokens.init(),
|
||||
# session.init(), # initializes session features
|
||||
# emailpassword.init(),
|
||||
# dashboard.init(admins=[
|
||||
# "yasienmeth@gmail.com",
|
||||
# ],
|
||||
# )
|
||||
# ],
|
||||
# mode='wsgi' # use wsgi instead of asgi if you are running using gunicorn
|
||||
# )
|
||||
@@ -1,21 +1,22 @@
|
||||
from fastapi import FastAPI, HTTPException
|
||||
from pydantic import BaseModel
|
||||
from .routers import docOffices, patients, patients_files, patients_notes, users, fileStorage, medicine
|
||||
# from .routers import docOffices, patients, patients_files, patients_notes, users, fileStorage, medicine
|
||||
import routers.docOffices as docOffices
|
||||
import routers.patients as patients
|
||||
import routers.patients_files as patients_files
|
||||
import routers.patients_notes as patients_notes
|
||||
import routers.users as users
|
||||
import routers.fileStorage as fileStorage
|
||||
import routers.medicine as medicine
|
||||
|
||||
from fastapi.middleware.cors import CORSMiddleware
|
||||
from fastapi.middleware import Middleware
|
||||
from supertokens_python import get_all_cors_headers
|
||||
from supertokens_python.framework.fastapi import get_middleware
|
||||
from supertokens_python.recipe.session.framework.fastapi import verify_session
|
||||
from supertokens_python.recipe.session import SessionContainer
|
||||
from fastapi import Depends
|
||||
|
||||
from supertokens_python.recipe.session.framework.fastapi import verify_session
|
||||
from supertokens_python.recipe.thirdparty.asyncio import (
|
||||
get_user_by_id as get_user_by_id_thirdparty,
|
||||
)
|
||||
from supertokens_python.recipe.passwordless.asyncio import (
|
||||
get_user_by_id as get_user_by_id_passwordless,
|
||||
)
|
||||
from supertokens_python import init, InputAppInfo, SupertokensConfig
|
||||
from supertokens_python.recipe import emailpassword, session, dashboard
|
||||
|
||||
|
||||
origins = [
|
||||
"http://localhost",
|
||||
@@ -27,15 +28,31 @@ origins = [
|
||||
"*",
|
||||
]
|
||||
|
||||
# middleware = [
|
||||
# Middleware(
|
||||
# CORSMiddleware,
|
||||
# allow_origins=origins,
|
||||
# allow_credentials=True,
|
||||
# allow_methods=["GET", "PUT", "POST", "DELETE", "OPTIONS", "PATCH"],
|
||||
# allow_headers=["Content-Type"] + get_all_cors_headers(),
|
||||
# )
|
||||
# ]
|
||||
init(
|
||||
app_info=InputAppInfo(
|
||||
app_name="MIH_API_HUB",
|
||||
api_domain="http://localhost:8080/",
|
||||
website_domain="http://mzansi-innovation-hub.co.za",
|
||||
api_base_path="/auth",
|
||||
website_base_path="/auth"
|
||||
),
|
||||
supertokens_config=SupertokensConfig(
|
||||
# https://try.supertokens.com is for demo purposes. Replace this with the address of your core instance (sign up on supertokens.com), or self host a core.
|
||||
connection_uri="http://MIH-SuperTokens:3567/",
|
||||
api_key="leatucczyixqwkqqdrhayiwzeofkltds"
|
||||
),
|
||||
framework='fastapi',
|
||||
recipe_list=[
|
||||
# SuperTokens.init(),
|
||||
session.init(), # initializes session features
|
||||
emailpassword.init(),
|
||||
dashboard.init(admins=[
|
||||
"yasienmeth@gmail.com",
|
||||
],
|
||||
)
|
||||
],
|
||||
mode='wsgi' # use wsgi instead of asgi if you are running using gunicorn
|
||||
)
|
||||
|
||||
app = FastAPI()#middleware=middleware)
|
||||
app.add_middleware(get_middleware())
|
||||
@@ -81,6 +98,6 @@ def read_root():
|
||||
# print(thirdparty_user)
|
||||
|
||||
def serverRunning():
|
||||
return {"Status": "Server is Up and Running"}
|
||||
return {"Status": "Server is Up and Running. whats good in the hood"}
|
||||
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ mysql-connector-python
|
||||
minio
|
||||
reportlab
|
||||
requests
|
||||
watchfiles==0.21.0
|
||||
watchfiles
|
||||
python-multipart
|
||||
xlrd
|
||||
supertokens-python
|
||||
@@ -1,17 +1,20 @@
|
||||
import mysql.connector
|
||||
from fastapi import APIRouter, HTTPException
|
||||
from ..database import dbConnection
|
||||
#from ..database import dbConnection
|
||||
import database
|
||||
#SuperToken Auth from front end
|
||||
from supertokens_python.recipe.session.framework.fastapi import verify_session
|
||||
from supertokens_python.recipe.session import SessionContainer
|
||||
from fastapi import Depends
|
||||
|
||||
import database.dbConnection
|
||||
|
||||
router = APIRouter()
|
||||
|
||||
# Get Doctors Office By ID
|
||||
@router.get("/docOffices/{docOffic_id}", tags="DocOffice")
|
||||
async def read_docOfficeByID(docOffic_id: int, session: SessionContainer = Depends(verify_session())):
|
||||
db = dbConnection.dbConnect()
|
||||
db = database.dbConnection.dbConnect()
|
||||
cursor = db.cursor()
|
||||
query = "SELECT * FROM doctor_offices WHERE iddoctor_offices=%s"
|
||||
cursor.execute(query, (docOffic_id,))
|
||||
@@ -26,7 +29,7 @@ async def read_docOfficeByID(docOffic_id: int, session: SessionContainer = Depen
|
||||
# Get Doctors Office By user
|
||||
@router.get("/docOffices/user/{user}", tags="DocOffice")
|
||||
async def read_docOfficeByID(user: str, session: SessionContainer = Depends(verify_session())):
|
||||
db = dbConnection.dbConnect()
|
||||
db = database.dbConnection.dbConnect()
|
||||
cursor = db.cursor()
|
||||
query = "SELECT * FROM users WHERE email=%s"
|
||||
cursor.execute(query, (user,))
|
||||
@@ -47,7 +50,7 @@ async def read_docOfficeByID(user: str, session: SessionContainer = Depends(veri
|
||||
# Get List of all Doctors Office
|
||||
@router.get("/docOffices/", tags="DocOffice")
|
||||
async def read_All_DoctorsOffice(session: SessionContainer = Depends(verify_session())):
|
||||
db = dbConnection.dbConnect()
|
||||
db = database.dbConnection.dbConnect()
|
||||
cursor = db.cursor()
|
||||
query = "SELECT * FROM doctor_offices"
|
||||
cursor.execute(query)
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import mysql.connector
|
||||
from fastapi import APIRouter, HTTPException
|
||||
from pydantic import BaseModel
|
||||
from ..database import dbConnection
|
||||
#from ..database import dbConnection
|
||||
import database
|
||||
#SuperToken Auth from front end
|
||||
from supertokens_python.recipe.session.framework.fastapi import verify_session
|
||||
from supertokens_python.recipe.session import SessionContainer
|
||||
@@ -46,7 +47,7 @@ class patientDeleteRequest(BaseModel):
|
||||
# Get Patient By ID Number
|
||||
@router.get("/patients/id/{pat_id}", tags="patients")
|
||||
async def read_patientByID(pat_id: str, session: SessionContainer = Depends(verify_session())):
|
||||
db = dbConnection.dbConnect()
|
||||
db = database.dbConnection.dbConnect()
|
||||
cursor = db.cursor()
|
||||
query = "SELECT * FROM patients WHERE idpatients=%s"
|
||||
cursor.execute(query, (pat_id,))
|
||||
@@ -71,7 +72,7 @@ async def read_patientByID(pat_id: str, session: SessionContainer = Depends(veri
|
||||
# Get Patient By ID Number
|
||||
@router.get("/patients/{id_no}", tags="patients")
|
||||
async def read_patientByID(id_no: str):
|
||||
db = dbConnection.dbConnect()
|
||||
db = database.dbConnection.dbConnect()
|
||||
cursor = db.cursor()
|
||||
query = "SELECT * FROM patients WHERE id_no=%s"
|
||||
cursor.execute(query, (id_no,))
|
||||
@@ -95,7 +96,7 @@ async def read_patientByID(id_no: str):
|
||||
# Get List of all patients
|
||||
@router.get("/patients/user/{email}", tags="patients")
|
||||
async def read_all_patientsByUser(email: str, session: SessionContainer = Depends(verify_session())):
|
||||
db = dbConnection.dbConnect()
|
||||
db = database.dbConnection.dbConnect()
|
||||
cursor = db.cursor()
|
||||
#query = "SELECT * FROM patients"
|
||||
query = "Select * from patients "
|
||||
@@ -129,7 +130,7 @@ async def read_all_patientsByUser(email: str, session: SessionContainer = Depend
|
||||
# Get List of all patients
|
||||
@router.get("/patients/", tags="patients")
|
||||
async def read_all_patients(session: SessionContainer = Depends(verify_session())):
|
||||
db = dbConnection.dbConnect()
|
||||
db = database.dbConnection.dbConnect()
|
||||
cursor = db.cursor()
|
||||
query = "SELECT * FROM patients"
|
||||
cursor.execute(query)
|
||||
@@ -156,7 +157,7 @@ async def read_all_patients(session: SessionContainer = Depends(verify_session()
|
||||
# Get List of all patients by Doctors Office
|
||||
@router.get("/patients/docOffice/{docoff_id}", tags="patients")
|
||||
async def read_all_patientsby(docoff_id: str, session: SessionContainer = Depends(verify_session())):
|
||||
db = dbConnection.dbConnect()
|
||||
db = database.dbConnection.dbConnect()
|
||||
cursor = db.cursor()
|
||||
query = "SELECT * FROM patients where doc_office_id=%s"
|
||||
cursor.execute(query, (docoff_id,))
|
||||
@@ -183,7 +184,7 @@ async def read_all_patientsby(docoff_id: str, session: SessionContainer = Depend
|
||||
# Insert Patient into table
|
||||
@router.post("/patients/insert/", tags="patients", status_code=201)
|
||||
async def insertPatient(itemRequest : patientInsertRequest, session: SessionContainer = Depends(verify_session())):
|
||||
db = dbConnection.dbConnect()
|
||||
db = database.dbConnection.dbConnect()
|
||||
cursor = db.cursor()
|
||||
query = "insert into patients "
|
||||
query += "(id_no, first_name, last_name, email, cell_no, medical_aid, "
|
||||
@@ -216,7 +217,7 @@ async def insertPatient(itemRequest : patientInsertRequest, session: SessionCont
|
||||
# Update Patient on table
|
||||
@router.put("/patients/update/", tags="patients")
|
||||
async def UpdatePatient(itemRequest : patientUpdateRequest, session: SessionContainer = Depends(verify_session())):
|
||||
db = dbConnection.dbConnect()
|
||||
db = database.dbConnection.dbConnect()
|
||||
cursor = db.cursor()
|
||||
query = "update patients "
|
||||
query += "set id_no=%s, first_name=%s, last_name=%s, email=%s, cell_no=%s, medical_aid=%s, "
|
||||
@@ -251,7 +252,7 @@ async def UpdatePatient(itemRequest : patientUpdateRequest, session: SessionCont
|
||||
# delete Patient on table
|
||||
@router.delete("/patients/delete/", tags="patients")
|
||||
async def DeletePatient(itemRequest : patientDeleteRequest, session: SessionContainer = Depends(verify_session())):
|
||||
db = dbConnection.dbConnect()
|
||||
db = database.dbConnection.dbConnect()
|
||||
cursor = db.cursor()
|
||||
query = "delete from patients "
|
||||
query += "where id_no=%s and doc_office_id=%s"
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import mysql.connector
|
||||
from fastapi import APIRouter, HTTPException
|
||||
from pydantic import BaseModel
|
||||
from ..database import dbConnection
|
||||
#from ..database import dbConnection
|
||||
import database
|
||||
from datetime import date
|
||||
#SuperToken Auth from front end
|
||||
from supertokens_python.recipe.session.framework.fastapi import verify_session
|
||||
@@ -22,7 +23,7 @@ class fileInsertRequest(BaseModel):
|
||||
# Get List of all files
|
||||
@router.get("/files/patients/", tags="patients_files")
|
||||
async def read_all_files(session: SessionContainer = Depends(verify_session())):
|
||||
db = dbConnection.dbConnect()
|
||||
db = database.dbConnection.dbConnect()
|
||||
cursor = db.cursor()
|
||||
query = "SELECT * FROM patient_files"
|
||||
cursor.execute(query)
|
||||
@@ -43,7 +44,7 @@ async def read_all_files(session: SessionContainer = Depends(verify_session())):
|
||||
# Get List of all files by patient
|
||||
@router.get("/files/patients/{patientID}", tags="patients_files")
|
||||
async def read_all_files_by_patient(patientID: int, session: SessionContainer = Depends(verify_session())):
|
||||
db = dbConnection.dbConnect()
|
||||
db = database.dbConnection.dbConnect()
|
||||
cursor = db.cursor()
|
||||
query = "SELECT * FROM patient_files where patient_id = %s ORDER BY insert_date DESC"
|
||||
cursor.execute(query, (patientID,))
|
||||
@@ -64,7 +65,7 @@ async def read_all_files_by_patient(patientID: int, session: SessionContainer =
|
||||
# Get List of all files by patient & DocOffice
|
||||
@router.get("/files/patients-docOffice/", tags="patients_files")
|
||||
async def read_all_files_by_patient(itemRequest: fileRequest, session: SessionContainer = Depends(verify_session())):
|
||||
db = dbConnection.dbConnect()
|
||||
db = database.dbConnection.dbConnect()
|
||||
cursor = db.cursor()
|
||||
query = "select patient_files.idpatient_files, patient_files.file_path, patient_files.file_name, patient_files.patient_id, patient_files.insert_date, patients.doc_office_id "
|
||||
query += "from patient_manager.patient_files "
|
||||
@@ -92,7 +93,7 @@ async def read_all_files_by_patient(itemRequest: fileRequest, session: SessionCo
|
||||
@router.post("/files/insert/", tags="patients_notes", status_code=201)
|
||||
async def insertPatientFiles(itemRequest : fileInsertRequest, session: SessionContainer = Depends(verify_session())):
|
||||
today = date.today()
|
||||
db = dbConnection.dbConnect()
|
||||
db = database.dbConnection.dbConnect()
|
||||
cursor = db.cursor()
|
||||
query = "insert into patient_files "
|
||||
query += "(file_path, file_name, patient_id, insert_date) "
|
||||
|
||||
@@ -2,7 +2,8 @@ import mysql.connector
|
||||
from fastapi import APIRouter, HTTPException
|
||||
from pydantic import BaseModel
|
||||
from datetime import date
|
||||
from ..database import dbConnection
|
||||
#from ..database import dbConnection
|
||||
import database
|
||||
#SuperToken Auth from front end
|
||||
from supertokens_python.recipe.session.framework.fastapi import verify_session
|
||||
from supertokens_python.recipe.session import SessionContainer
|
||||
@@ -28,7 +29,7 @@ class patientNoteUpdateRequest(BaseModel):
|
||||
# Get List of all notes
|
||||
@router.get("/notes/patients/", tags="patients_notes")
|
||||
async def read_all_notes(session: SessionContainer = Depends(verify_session())):
|
||||
db = dbConnection.dbConnect()
|
||||
db = database.dbConnection.dbConnect()
|
||||
cursor = db.cursor()
|
||||
query = "SELECT * FROM patient_notes"
|
||||
cursor.execute(query)
|
||||
@@ -48,7 +49,7 @@ async def read_all_notes(session: SessionContainer = Depends(verify_session())):
|
||||
# Get List of all notes by patient
|
||||
@router.get("/notes/patients/{patientID}", tags="patients_notes")
|
||||
async def read_all_patientsby(patientID: int, session: SessionContainer = Depends(verify_session())):
|
||||
db = dbConnection.dbConnect()
|
||||
db = database.dbConnection.dbConnect()
|
||||
cursor = db.cursor()
|
||||
query = "SELECT * FROM patient_notes where patient_id = %s ORDER BY insert_date DESC"
|
||||
cursor.execute(query, (patientID,))
|
||||
@@ -69,7 +70,7 @@ async def read_all_patientsby(patientID: int, session: SessionContainer = Depend
|
||||
# Get List of all notes by patient
|
||||
@router.get("/notes/patients-docOffice/", tags="patients_notes")
|
||||
async def read_all_patientsby(itemRequest: fileRequest, session: SessionContainer = Depends(verify_session())):
|
||||
db = dbConnection.dbConnect()
|
||||
db = database.dbConnection.dbConnect()
|
||||
cursor = db.cursor()
|
||||
query = "select patient_notes.idpatient_notes, patient_notes.note_name, patient_notes.note_text, patient_notes.patient_id, patient_notes.insert_date, patients.doc_office_id "
|
||||
query += "from patient_manager.patient_notes "
|
||||
@@ -94,7 +95,7 @@ async def read_all_patientsby(itemRequest: fileRequest, session: SessionContaine
|
||||
@router.post("/notes/insert/", tags="patients_notes", status_code=201)
|
||||
async def insertPatientNotes(itemRequest : patientNoteInsertRequest, session: SessionContainer = Depends(verify_session())):
|
||||
today = date.today()
|
||||
db = dbConnection.dbConnect()
|
||||
db = database.dbConnection.dbConnect()
|
||||
cursor = db.cursor()
|
||||
query = "insert into patient_notes "
|
||||
query += "(note_name, note_text, patient_id, insert_date) "
|
||||
@@ -117,7 +118,7 @@ async def insertPatientNotes(itemRequest : patientNoteInsertRequest, session: Se
|
||||
@router.put("/notes/update/", tags="patients_notes")
|
||||
async def UpdatePatient(itemRequest : patientNoteUpdateRequest, session: SessionContainer = Depends(verify_session())):
|
||||
today = date.today()
|
||||
db = dbConnection.dbConnect()
|
||||
db = database.dbConnection.dbConnect()
|
||||
cursor = db.cursor()
|
||||
query = "update patient_notes "
|
||||
query += "set note_name=%s, note_text=%s, patient_id=%s, insert_date=%s "
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
from fastapi import APIRouter, HTTPException
|
||||
from pydantic import BaseModel
|
||||
from ..database import dbConnection
|
||||
#from ..database import dbConnection
|
||||
import database
|
||||
#SuperToken Auth from front end
|
||||
from supertokens_python.recipe.session.framework.fastapi import verify_session
|
||||
from supertokens_python.recipe.session import SessionContainer
|
||||
@@ -25,7 +26,7 @@ class userUpdateRequest(BaseModel):
|
||||
#get user by email & doc Office ID
|
||||
@router.get("/users/profile/{email}", tags="users")
|
||||
async def read_all_users(email: str, session: SessionContainer = Depends(verify_session())):
|
||||
db = dbConnection.dbConnect()
|
||||
db = database.dbConnection.dbConnect()
|
||||
cursor = db.cursor()
|
||||
query = "SELECT * FROM users where email = %s"
|
||||
cursor.execute(query, (email.lower(),))
|
||||
@@ -49,7 +50,7 @@ async def read_all_users(email: str, session: SessionContainer = Depends(verify_
|
||||
# Get List of all files
|
||||
@router.get("/users/", tags="users")
|
||||
async def read_all_users(session: SessionContainer = Depends(verify_session())):
|
||||
db = dbConnection.dbConnect()
|
||||
db = database.dbConnection.dbConnect()
|
||||
cursor = db.cursor()
|
||||
query = "SELECT * FROM users"
|
||||
cursor.execute(query)
|
||||
@@ -73,7 +74,7 @@ async def read_all_users(session: SessionContainer = Depends(verify_session())):
|
||||
# Get List of all files
|
||||
@router.get("/user/{uid}", tags="users")
|
||||
async def read_all_users(uid: str, session: SessionContainer = Depends(verify_session())):
|
||||
db = dbConnection.dbConnect()
|
||||
db = database.dbConnection.dbConnect()
|
||||
cursor = db.cursor()
|
||||
query = "SELECT * FROM users where app_id = %s"
|
||||
cursor.execute(query, (uid,))
|
||||
@@ -97,7 +98,7 @@ async def read_all_users(uid: str, session: SessionContainer = Depends(verify_se
|
||||
# Insert Patient into table
|
||||
@router.post("/user/insert/", tags="user", status_code=201)
|
||||
async def insertPatient(itemRequest : userInsertRequest, session: SessionContainer = Depends(verify_session())):
|
||||
db = dbConnection.dbConnect()
|
||||
db = database.dbConnection.dbConnect()
|
||||
cursor = db.cursor()
|
||||
query = "insert into users "
|
||||
query += "(email, docOffice_id, fname, lname, type, app_id, username) "
|
||||
@@ -117,7 +118,7 @@ async def insertPatient(itemRequest : userInsertRequest, session: SessionContain
|
||||
# Update User on table
|
||||
@router.put("/user/update/", tags="user")
|
||||
async def UpdateUser(itemRequest : userUpdateRequest, session: SessionContainer = Depends(verify_session())):
|
||||
db = dbConnection.dbConnect()
|
||||
db = database.dbConnection.dbConnect()
|
||||
cursor = db.cursor()
|
||||
query = "update users "
|
||||
query += "set username=%s, fname=%s, lname=%s "
|
||||
|
||||
Reference in New Issue
Block a user