|
|
@ -32,7 +32,7 @@ async def subscribe(subscription: PushSubscription, current_user: User = Depends
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
# Check if already has a subscription
|
|
|
|
# Check if already has a subscription
|
|
|
|
if current_user.get("push_subscriptions"):
|
|
|
|
if current_user.push_subscriptions:
|
|
|
|
# Add another subscription
|
|
|
|
# Add another subscription
|
|
|
|
users_collection.update_one(
|
|
|
|
users_collection.update_one(
|
|
|
|
{"username": current_user.username},
|
|
|
|
{"username": current_user.username},
|
|
|
|