forked from yaso_meth/mih-project
Update user api to include user type
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
from fastapi import FastAPI, HTTPException
|
||||
from fastapi import FastAPI, Depends, HTTPException
|
||||
from pydantic import BaseModel
|
||||
# from .routers import docOffices, patients, patients_files, patients_notes, users, fileStorage, medicine
|
||||
import routers.docOffices as docOffices
|
||||
@@ -15,9 +15,13 @@ from supertokens_python import get_all_cors_headers
|
||||
from supertokens_python.framework.fastapi import get_middleware
|
||||
|
||||
from supertokens_python import init, InputAppInfo, SupertokensConfig
|
||||
from supertokens_python.recipe import emailpassword, session, dashboard
|
||||
from supertokens_python.recipe import emailpassword, session, dashboard, emailverification
|
||||
|
||||
|
||||
from supertokens_python.recipe.session.framework.fastapi import verify_session
|
||||
from supertokens_python.recipe.emailverification import EmailVerificationClaim
|
||||
from supertokens_python.recipe.session import SessionContainer
|
||||
|
||||
origins = [
|
||||
"http://localhost",
|
||||
"http://localhost:80",
|
||||
@@ -46,6 +50,7 @@ init(
|
||||
# SuperTokens.init(),
|
||||
session.init(), # initializes session features
|
||||
emailpassword.init(),
|
||||
# emailverification.init(mode='REQUIRED'),
|
||||
dashboard.init(admins=[
|
||||
"yasienmeth@gmail.com",
|
||||
],
|
||||
|
||||
@@ -24,6 +24,7 @@ class userUpdateRequest(BaseModel):
|
||||
username: str
|
||||
fnam: str
|
||||
lname: str
|
||||
type: str
|
||||
|
||||
# #get user by email & doc Office ID
|
||||
# @router.get("/users/profile/{email}", tags="users")
|
||||
@@ -122,11 +123,12 @@ async def Update_User_details(itemRequest : userUpdateRequest, session: SessionC
|
||||
db = database.dbConnection.dbAppDataConnect()
|
||||
cursor = db.cursor()
|
||||
query = "update users "
|
||||
query += "set username=%s, fname=%s, lname=%s "
|
||||
query += "set username=%s, fname=%s, lname=%s, type=%s "
|
||||
query += "where idusers=%s"
|
||||
userData = (itemRequest.username,
|
||||
itemRequest.fnam,
|
||||
itemRequest.lname,
|
||||
itemRequest.type,
|
||||
itemRequest.idusers,
|
||||
)
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user