rework
This commit is contained in:
parent
97210edb07
commit
712c5ec83b
@ -20,7 +20,8 @@ async def get_profile_by_user_id(user_id: UUID, token: str) -> dict:
|
|||||||
detail=f"profile_service: {response.text}"
|
detail=f"profile_service: {response.text}"
|
||||||
)
|
)
|
||||||
|
|
||||||
return response.json()
|
wrapped = response.json()
|
||||||
|
return wrapped["data"]
|
||||||
|
|
||||||
except httpx.RequestError:
|
except httpx.RequestError:
|
||||||
raise HTTPException(status_code=status.HTTP_503_SERVICE_UNAVAILABLE, detail="Token service unavailable")
|
raise HTTPException(status_code=status.HTTP_503_SERVICE_UNAVAILABLE, detail="Token service unavailable")
|
||||||
@ -41,7 +42,8 @@ async def get_profiles_by_user_ids(user_ids: List[UUID], token: str, user_id: UU
|
|||||||
detail=f"profile_service: {response.text}"
|
detail=f"profile_service: {response.text}"
|
||||||
)
|
)
|
||||||
|
|
||||||
return response.json()
|
wrapped = response.json()
|
||||||
|
return wrapped["data"]
|
||||||
|
|
||||||
except httpx.RequestError as e:
|
except httpx.RequestError as e:
|
||||||
raise HTTPException(status_code=status.HTTP_503_SERVICE_UNAVAILABLE, detail=f"profile_service unreachable: {str(e)}")
|
raise HTTPException(status_code=status.HTTP_503_SERVICE_UNAVAILABLE, detail=f"profile_service unreachable: {str(e)}")
|
||||||
|
|||||||
@ -47,7 +47,8 @@ async def _fetch_current_user(
|
|||||||
detail=f"token_service: {response.text}"
|
detail=f"token_service: {response.text}"
|
||||||
)
|
)
|
||||||
|
|
||||||
data = response.json()
|
wrapped = response.json()
|
||||||
|
data = wrapped["data"]
|
||||||
|
|
||||||
return CurrentUser(
|
return CurrentUser(
|
||||||
token=token,
|
token=token,
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
[project]
|
[project]
|
||||||
name = "common-lib"
|
name = "common-lib"
|
||||||
version = "0.0.17"
|
version = "0.0.18"
|
||||||
description = "Библиотека общих компонентов для микросервисов yobble"
|
description = "Библиотека общих компонентов для микросервисов yobble"
|
||||||
authors = [{ name = "cheykrym", email = "you@example.com" }]
|
authors = [{ name = "cheykrym", email = "you@example.com" }]
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user