TODOs for @Andrei-Dolgolev, @kompotkot

pull/105/head
Neeraj Kashyap 2021-08-10 06:17:46 -07:00
rodzic e469658aee
commit 53425e88c3
2 zmienionych plików z 6 dodań i 1 usunięć

Wyświetl plik

@ -62,11 +62,13 @@ async def search_transactions(
include_end: bool = Query(False),
db_session: Session = Depends(db.yield_db_session),
):
# get user subscriptions
token = request.state.token
params = {"user_id": str(request.state.user.id)}
try:
# TODO(andrey, kompotkot): This query should filter resources of type "subscription". We may
# create other resources for users. When we do, I think this code will break.
# See how we apply this filter for "type": "subscription_type" in the /subscriptions route.
user_subscriptions_resources: BugoutResources = bc.list_resources(
token=token, params=params
)

Wyświetl plik

@ -97,6 +97,9 @@ async def add_subscription_handler(
# chek if that contract not already setted up
# TODO(andrey, kompotkot): I think you should add a "type": "subscription" in the resource_data.
# This is related to TODO I created in /streams route handler.
# TODO(andrey, kompotkot): Is "user_id" required to store in the resource if we resolve user through their token?
resource_data = {"user_id": str(user.id)}
resource_data.update(subscription_data)