Compare commits
No commits in common. "b5af28c5b1589004a838bc8ebc71f9ca45d74a07" and "3351499e736a22772af5a83e37c09f95af2c68b8" have entirely different histories.
b5af28c5b1
...
3351499e73
|
@ -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.
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue