Type notification's 'data' field as a string

This commit is contained in:
Peter Vacho 2025-01-04 13:03:49 +01:00
parent 165e00e0df
commit b5af28c5b1
Signed by: school
GPG key ID: 8CFC3837052871B4

View file

@ -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
@ -28,7 +28,7 @@ class NotificationData(BaseModel):
user_id: PydanticObjectId
event_type: Literal["message", "invitation"]
message: str
data: Any
data: str
read: bool
created_at: datetime
read_at: datetime | None