WIP: Add timestamp to comments and fix frontend errors
This commit is contained in:
@@ -8,6 +8,7 @@ from pydantic import BaseModel, ConfigDict
|
||||
|
||||
class SongCommentCreate(BaseModel):
|
||||
body: str
|
||||
timestamp: float | None = None
|
||||
|
||||
|
||||
class SongCommentRead(BaseModel):
|
||||
@@ -18,6 +19,7 @@ class SongCommentRead(BaseModel):
|
||||
body: str
|
||||
author_id: uuid.UUID
|
||||
author_name: str
|
||||
timestamp: float | None
|
||||
created_at: datetime
|
||||
|
||||
@classmethod
|
||||
@@ -28,5 +30,6 @@ class SongCommentRead(BaseModel):
|
||||
body=getattr(c, "body"),
|
||||
author_id=getattr(c, "author_id"),
|
||||
author_name=getattr(getattr(c, "author"), "display_name"),
|
||||
timestamp=getattr(c, "timestamp"),
|
||||
created_at=getattr(c, "created_at"),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user