fix activedomain
This commit is contained in:
@@ -368,21 +368,21 @@ async def userdomain_delete(
|
||||
|
||||
@r.get(
|
||||
"/activedomain",
|
||||
response_model=ApiReturnModel[Domain],
|
||||
response_model=ApiReturnModel[ActiveDomain|None],
|
||||
response_model_exclude_none=True,
|
||||
)
|
||||
async def get_useractivedomain(
|
||||
async def get_activeuserdomain(
|
||||
request: Request,
|
||||
userId: Optional[int] = Query(None, alias="userId"),
|
||||
user=Depends(get_current_active_user),
|
||||
db=Depends(get_db),
|
||||
):
|
||||
try:
|
||||
# domain = get_activedomain(db, user.id)
|
||||
domain = get_activedomain(db, userId if userId is not None else user.id)
|
||||
domain = get_activedomain(db, user.id)
|
||||
# if domain is None:
|
||||
# return JSONResponse(content=None,status_code=HTTPStatus.OK)
|
||||
return ApiReturnModel(data =domain)
|
||||
return ApiReturnModel(data = domain)
|
||||
|
||||
except Exception as e:
|
||||
raise APIException('platform:activedomain',request.url._url,f"Error occurred while get user({user.id}) activedomain:",e)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user