active user
Browse files- App/Users/UserRoutes.py +3 -3
App/Users/UserRoutes.py
CHANGED
@@ -170,7 +170,7 @@ async def get_all_users(admin: User = Depends(get_admin_user)):
|
|
170 |
@user_router.delete(
|
171 |
"/user/{user_id}", response_model=BaseResponse, status_code=status.HTTP_200_OK
|
172 |
)
|
173 |
-
async def delete_user(user_id: str, admin: User = Depends(
|
174 |
user = await User.filter(id=user_id).first()
|
175 |
if not user:
|
176 |
raise HTTPException(
|
@@ -185,7 +185,7 @@ async def delete_user(user_id: str, admin: User = Depends(get_current_active_use
|
|
185 |
response_model=BaseResponse,
|
186 |
status_code=status.HTTP_200_OK,
|
187 |
)
|
188 |
-
async def toggle_user_status(user_id: str):
|
189 |
user = await User.filter(id=user_id).first()
|
190 |
if not user:
|
191 |
raise HTTPException(
|
@@ -248,7 +248,7 @@ async def activate_user(user_id: str):
|
|
248 |
@user_router.get(
|
249 |
"/users/active", response_model=List[str]
|
250 |
) # Change response model to List[str]
|
251 |
-
async def get_active_users():
|
252 |
# Fetch all active users using the Android client
|
253 |
api_response: APIResponse = await client.get_active_users()
|
254 |
active_users = api_response.active_users
|
|
|
170 |
@user_router.delete(
|
171 |
"/user/{user_id}", response_model=BaseResponse, status_code=status.HTTP_200_OK
|
172 |
)
|
173 |
+
async def delete_user(user_id: str, admin: User = Depends(get_admin_user)):
|
174 |
user = await User.filter(id=user_id).first()
|
175 |
if not user:
|
176 |
raise HTTPException(
|
|
|
185 |
response_model=BaseResponse,
|
186 |
status_code=status.HTTP_200_OK,
|
187 |
)
|
188 |
+
async def toggle_user_status(user_id: str, admin: User = Depends(get_admin_user)):
|
189 |
user = await User.filter(id=user_id).first()
|
190 |
if not user:
|
191 |
raise HTTPException(
|
|
|
248 |
@user_router.get(
|
249 |
"/users/active", response_model=List[str]
|
250 |
) # Change response model to List[str]
|
251 |
+
async def get_active_users(admin: User = Depends(get_admin_user)):
|
252 |
# Fetch all active users using the Android client
|
253 |
api_response: APIResponse = await client.get_active_users()
|
254 |
active_users = api_response.active_users
|