Compare commits

..

No commits in common. "b5af28c5b1589004a838bc8ebc71f9ca45d74a07" and "3351499e736a22772af5a83e37c09f95af2c68b8" have entirely different histories.

3 changed files with 6 additions and 6 deletions

View file

@ -152,8 +152,8 @@ async def get_user_invitatinos(user_id: PydanticObjectId, user: CurrentUserDep)
return [InvitationData.from_invitation(invitation) for invitation in invitations]
@base_router.get("/users/{user_id}/invitations/incoming")
async def get_user_incoming_invitatinos(user_id: PydanticObjectId, user: CurrentUserDep) -> list[InvitationData]:
@base_router.get("/users/{user_id}/invitations/incomming")
async def get_user_incomming_invitatinos(user_id: PydanticObjectId, user: CurrentUserDep) -> list[InvitationData]:
"""Get all incoming invitations for a given user.
Note that this endpoint only allows you to access the invitations you received.

View file

@ -1,5 +1,5 @@
from datetime import UTC, datetime
from typing import Literal, cast, final
from typing import Any, Literal, cast, final
from beanie import Link, PydanticObjectId
from fastapi import APIRouter, HTTPException, status
@ -26,9 +26,9 @@ class NotificationData(BaseModel):
id: PydanticObjectId
user_id: PydanticObjectId
event_type: Literal["message", "invitation"]
event_type: Literal["reminder", "invitation"]
message: str
data: str
data: Any
read: bool
created_at: datetime
read_at: datetime | None

View file

@ -13,7 +13,7 @@ class Notification(Document):
"""Notification table."""
user: Annotated[BeanieLink[User], Indexed()]
event_type: Annotated[Literal["message", "invitation"], Indexed()]
event_type: Annotated[Literal["reminder", "invitation"], Indexed()]
message: str
data: str
read: bool