Add a unified event editor that works in two modes: - Calendar mode: Create/edit events directly via EventService API - Chat mode: Edit AI-proposed events before confirming them The chat mode allows users to modify proposed events (title, time, recurrence) and persists changes both locally and to the server. New components: DateTimePicker, ScrollableDropdown, useDropdownPosition New API: PUT /api/chat/messages/:messageId/proposal
28 lines
869 B
TypeScript
28 lines
869 B
TypeScript
import { Router } from "express";
|
|
import { ChatController, authenticate } from "../controllers";
|
|
|
|
export function createChatRoutes(chatController: ChatController): Router {
|
|
const router = Router();
|
|
|
|
router.use(authenticate);
|
|
|
|
router.post("/message", (req, res) => chatController.sendMessage(req, res));
|
|
router.post("/confirm/:conversationId/:messageId", (req, res) =>
|
|
chatController.confirmEvent(req, res),
|
|
);
|
|
router.post("/reject/:conversationId/:messageId", (req, res) =>
|
|
chatController.rejectEvent(req, res),
|
|
);
|
|
router.get("/conversations", (req, res) =>
|
|
chatController.getConversations(req, res),
|
|
);
|
|
router.get("/conversations/:id", (req, res) =>
|
|
chatController.getConversation(req, res),
|
|
);
|
|
router.put("/messages/:messageId/proposal", (req, res) =>
|
|
chatController.updateProposalEvent(req, res),
|
|
);
|
|
|
|
return router;
|
|
}
|