Патч
All checks were successful
Build And Push / publish (push) Successful in 1m12s

This commit is contained in:
2025-11-12 12:19:30 +03:00
parent cf1324633d
commit 043de7e034
8 changed files with 76 additions and 21 deletions

View File

@ -31,7 +31,12 @@ async def get_profile(user: Annotated[User, Depends(login)]):
return await c.vitacore_api.getProfile(user.vita_id)
@router.get('/getDepartments', response_model=list[vs.OrganizationsModel])
@router.get(
'/getDepartments',
responses={
status.HTTP_200_OK: {'model': vs.OrganizationsModel},
},
)
async def get_departments():
"""
Get list of departments.
@ -346,7 +351,7 @@ async def measurement(
'status': status,
}
cache_key = f'tdn:measurement:{user.id}:{created}'
cache.set(cache_key, dumps(data))
await cache.set(cache_key, dumps(data))
@router.get('/measurements')
@ -354,6 +359,7 @@ async def measurements(
user: Annotated[User, Depends(login)],
):
data = [
cache.get(key) for key in cache.keys(f'tdn:measurement:{user.id}:*')
cache.get(key)
for key in await cache.keys(f'tdn:measurement:{user.id}:*')
]
return data