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 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.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.framework.fastapi import get_middleware
|
||||||
|
|
||||||
from supertokens_python import init, InputAppInfo, SupertokensConfig
|
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 = [
|
origins = [
|
||||||
"http://localhost",
|
"http://localhost",
|
||||||
"http://localhost:80",
|
"http://localhost:80",
|
||||||
@@ -46,6 +50,7 @@ init(
|
|||||||
# SuperTokens.init(),
|
# SuperTokens.init(),
|
||||||
session.init(), # initializes session features
|
session.init(), # initializes session features
|
||||||
emailpassword.init(),
|
emailpassword.init(),
|
||||||
|
# emailverification.init(mode='REQUIRED'),
|
||||||
dashboard.init(admins=[
|
dashboard.init(admins=[
|
||||||
"yasienmeth@gmail.com",
|
"yasienmeth@gmail.com",
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ class userUpdateRequest(BaseModel):
|
|||||||
username: str
|
username: str
|
||||||
fnam: str
|
fnam: str
|
||||||
lname: str
|
lname: str
|
||||||
|
type: str
|
||||||
|
|
||||||
# #get user by email & doc Office ID
|
# #get user by email & doc Office ID
|
||||||
# @router.get("/users/profile/{email}", tags="users")
|
# @router.get("/users/profile/{email}", tags="users")
|
||||||
@@ -122,11 +123,12 @@ async def Update_User_details(itemRequest : userUpdateRequest, session: SessionC
|
|||||||
db = database.dbConnection.dbAppDataConnect()
|
db = database.dbConnection.dbAppDataConnect()
|
||||||
cursor = db.cursor()
|
cursor = db.cursor()
|
||||||
query = "update users "
|
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"
|
query += "where idusers=%s"
|
||||||
userData = (itemRequest.username,
|
userData = (itemRequest.username,
|
||||||
itemRequest.fnam,
|
itemRequest.fnam,
|
||||||
itemRequest.lname,
|
itemRequest.lname,
|
||||||
|
itemRequest.type,
|
||||||
itemRequest.idusers,
|
itemRequest.idusers,
|
||||||
)
|
)
|
||||||
try:
|
try:
|
||||||
|
|||||||
Reference in New Issue
Block a user