feat(message): store messages in Postgres
This commit is contained in:
@@ -53,7 +53,7 @@ func (h *MessageHandler) Create(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
message, err := h.service.Create(userID, chatID, req.Text)
|
||||
message, err := h.service.Create(r.Context(), userID, chatID, req.Text)
|
||||
switch {
|
||||
case errors.Is(err, service.ErrMessageChatNotFound):
|
||||
httpx.WriteError(
|
||||
@@ -93,7 +93,7 @@ func (h *MessageHandler) List(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
messages, nextCursor, err := h.service.List(userID, chatID, limit, cursor)
|
||||
messages, nextCursor, err := h.service.List(r.Context(), userID, chatID, limit, cursor)
|
||||
switch {
|
||||
case errors.Is(err, service.ErrMessageChatNotFound):
|
||||
httpx.WriteError(
|
||||
|
||||
Reference in New Issue
Block a user