implement event persistence and improve Mongoose TypeScript patterns
- Add event persistence: confirmed events are now saved to MongoDB - Refactor Mongoose models to use virtuals for id field with IdVirtual interface - Update repositories to use toJSON() with consistent type casting - Add more test responses for chat (doctor, birthday, gym, etc.) - Show event description in ProposedEventCard - Change mongo-express port to 8083 - Update CLAUDE.md with Mongoose model pattern documentation
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { Response } from 'express';
|
||||
import { SendMessageDTO } from '@caldav/shared';
|
||||
import { SendMessageDTO, CreateEventDTO } from '@caldav/shared';
|
||||
import { ChatService } from '../services';
|
||||
import { AuthenticatedRequest } from '../middleware';
|
||||
|
||||
@@ -21,7 +21,8 @@ export class ChatController {
|
||||
try {
|
||||
const userId = req.user!.userId;
|
||||
const { conversationId, messageId } = req.params;
|
||||
const response = await this.chatService.confirmEvent(userId, conversationId, messageId);
|
||||
const event: CreateEventDTO = req.body;
|
||||
const response = await this.chatService.confirmEvent(userId, conversationId, messageId, event);
|
||||
res.json(response);
|
||||
} catch (error) {
|
||||
res.status(500).json({ error: 'Failed to confirm event' });
|
||||
|
||||
Reference in New Issue
Block a user