Compare commits
3 commits
3351499e73
...
b5af28c5b1
Author | SHA1 | Date | |
---|---|---|---|
Peter Vacho | b5af28c5b1 | ||
Peter Vacho | 165e00e0df | ||
Peter Vacho | d0f95140df |
|
@ -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/incomming")
|
||||
async def get_user_incomming_invitatinos(user_id: PydanticObjectId, user: CurrentUserDep) -> list[InvitationData]:
|
||||
@base_router.get("/users/{user_id}/invitations/incoming")
|
||||
async def get_user_incoming_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.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
from datetime import UTC, datetime
|
||||
from typing import Any, Literal, cast, final
|
||||
from typing import 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["reminder", "invitation"]
|
||||
event_type: Literal["message", "invitation"]
|
||||
message: str
|
||||
data: Any
|
||||
data: str
|
||||
read: bool
|
||||
created_at: datetime
|
||||
read_at: datetime | None
|
||||
|
|
|
@ -13,7 +13,7 @@ class Notification(Document):
|
|||
"""Notification table."""
|
||||
|
||||
user: Annotated[BeanieLink[User], Indexed()]
|
||||
event_type: Annotated[Literal["reminder", "invitation"], Indexed()]
|
||||
event_type: Annotated[Literal["message", "invitation"], Indexed()]
|
||||
message: str
|
||||
data: str
|
||||
read: bool
|
||||
|
|
Loading…
Reference in a new issue