kopia lustrzana https://github.com/bugout-dev/moonstream
TODOs for @Andrei-Dolgolev, @kompotkot
rodzic
e469658aee
commit
53425e88c3
|
@ -62,11 +62,13 @@ async def search_transactions(
|
||||||
include_end: bool = Query(False),
|
include_end: bool = Query(False),
|
||||||
db_session: Session = Depends(db.yield_db_session),
|
db_session: Session = Depends(db.yield_db_session),
|
||||||
):
|
):
|
||||||
|
|
||||||
# get user subscriptions
|
# get user subscriptions
|
||||||
token = request.state.token
|
token = request.state.token
|
||||||
params = {"user_id": str(request.state.user.id)}
|
params = {"user_id": str(request.state.user.id)}
|
||||||
try:
|
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(
|
user_subscriptions_resources: BugoutResources = bc.list_resources(
|
||||||
token=token, params=params
|
token=token, params=params
|
||||||
)
|
)
|
||||||
|
|
|
@ -97,6 +97,9 @@ async def add_subscription_handler(
|
||||||
|
|
||||||
# chek if that contract not already setted up
|
# 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 = {"user_id": str(user.id)}
|
||||||
resource_data.update(subscription_data)
|
resource_data.update(subscription_data)
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue