Remove API key From Console
parent
d16680053a
commit
cac20fbbf3
8
main.py
8
main.py
|
|
@ -257,11 +257,11 @@ async def get_user_id(get: CL.CL_GET_USER_ID,api_key: APIKey = Depends(auth.get_
|
||||||
|
|
||||||
@app.post("/report/addusertogroup")
|
@app.post("/report/addusertogroup")
|
||||||
async def get_addusertogroup(get: CL.CL_ADD_USER_TO_GROUP,api_key: APIKey = Depends(auth.get_api_key)):
|
async def get_addusertogroup(get: CL.CL_ADD_USER_TO_GROUP,api_key: APIKey = Depends(auth.get_api_key)):
|
||||||
result = database(f"INSERT INTO `{get.dbname}`.GruppenToUser (UserID,GruppenID) VALUES ({get.userID},{get.groupID})","","")
|
check = database(f"SELECT * FROM `{get.dbname}`.GruppenToUser WHERE UserID = {get.userID} AND GruppenID = {get.groupID}","","")
|
||||||
if not result:
|
if not check:
|
||||||
return False
|
database(f"INSERT INTO `{get.dbname}`.GruppenToUser (UserID,GruppenID) VALUES ({get.userID},{get.groupID})","","")
|
||||||
else:
|
else:
|
||||||
return result[0][0]
|
return check[0][0]
|
||||||
|
|
||||||
@app.post("/report/addgroup")
|
@app.post("/report/addgroup")
|
||||||
async def get_addreport_group(get: CL.CL_ADD_REPORT_GROUP,api_key: APIKey = Depends(auth.get_api_key)):
|
async def get_addreport_group(get: CL.CL_ADD_REPORT_GROUP,api_key: APIKey = Depends(auth.get_api_key)):
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue