🌿 fix: Message Route Improvements (#3378)

* fix: do not throw errors for invalid convo id, simply return undefined

* feat: Add error handling and logging to message route definitions

* feat: Refactor Message.js to improve code organization and readability

* fix: Return undefined instead of throwing error for invalid conversation ID in Message.spec.js
This commit is contained in:
Danny Avila 2024-07-18 10:07:10 -04:00 committed by GitHub
parent 5d40d0a37a
commit 1acd47a0f6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 79 additions and 48 deletions

View file

@ -78,7 +78,7 @@ describe('Message Operations', () => {
it('should throw an error for invalid conversation ID', async () => {
mockMessage.conversationId = 'invalid-id';
await expect(saveMessage(mockReq, mockMessage)).rejects.toThrow('Invalid conversation ID');
await expect(saveMessage(mockReq, mockMessage)).resolves.toBeUndefined();
});
});