mirror of
https://github.com/abhinavxd/libredesk.git
synced 2026-09-23 02:53:32 +00:00
fix errors while fetching draft on conversation without any saved drafts
This commit is contained in:
@@ -1094,6 +1094,9 @@ func (m *Manager) GetConversationDraft(conversationID int, uuid string, userID i
|
||||
}
|
||||
|
||||
if err := m.q.GetConversationDraft.Get(&draft, conversationID, uuidParam, userID); err != nil {
|
||||
if err == sql.ErrNoRows {
|
||||
return draft, nil
|
||||
}
|
||||
m.lo.Error("error fetching conversation draft", "conversation_id", conversationID, "uuid", uuid, "user_id", userID, "error", err)
|
||||
return draft, envelope.NewError(envelope.GeneralError, m.i18n.Ts("globals.messages.errorFetching", "name", "draft"), nil)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user