forked from mtusi2026/mtusi2026lab4
feat: implement S3 attachments and presigned uploads
This commit is contained in:
+2
-2
@@ -20,7 +20,7 @@ def message_to_response(message) -> MessageResponse:
|
||||
return MessageResponse(
|
||||
id=str(message.id), chat_id=str(message.chat_id),
|
||||
sender_id=str(message.sender_id), text=message.text,
|
||||
created_at=message.created_at,
|
||||
created_at=message.created_at, attachment_ids=message.attachment_ids or [],
|
||||
)
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ def create_message(
|
||||
try:
|
||||
message = MessageService(db).create_message(
|
||||
chat_id=parsed_id, sender_id=user.id, text=body.text,
|
||||
idempotency_key=idempotency_key,
|
||||
idempotency_key=idempotency_key, attachment_ids=body.attachment_ids,
|
||||
)
|
||||
return message_to_response(message)
|
||||
except MessageNotFoundError:
|
||||
|
||||
Reference in New Issue
Block a user