feat: add EditEventScreen with calendar and chat mode support
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
This commit is contained in:
@@ -150,4 +150,33 @@ export class ChatController {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async updateProposalEvent(
|
||||
req: AuthenticatedRequest,
|
||||
res: Response,
|
||||
): Promise<void> {
|
||||
try {
|
||||
const { messageId } = req.params;
|
||||
const { proposalId, event } = req.body as {
|
||||
proposalId: string;
|
||||
event: CreateEventDTO;
|
||||
};
|
||||
const message = await this.chatService.updateProposalEvent(
|
||||
messageId,
|
||||
proposalId,
|
||||
event,
|
||||
);
|
||||
if (message) {
|
||||
res.json(message);
|
||||
} else {
|
||||
res.status(404).json({ error: "Message or proposal not found" });
|
||||
}
|
||||
} catch (error) {
|
||||
log.error(
|
||||
{ error, messageId: req.params.messageId },
|
||||
"Error updating proposal event",
|
||||
);
|
||||
res.status(500).json({ error: "Failed to update proposal event" });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user