feat: add case creation endpoint and auto-title from first message

POST /api/cases lets the frontend actually create a new dava dosyası
(no working "Yeni Dosya" flow existed before). chatMessage now
generates a short title from a case's first message (like Claude/
ChatGPT auto-titling) and renames the case, returned as `newTitle`.
This commit is contained in:
mstfyldz
2026-08-09 10:34:55 +03:00
parent 7b354d4f96
commit 0e40aaef96
3 changed files with 75 additions and 2 deletions
+2 -1
View File
@@ -1,9 +1,10 @@
import { Router } from 'express';
import { requireAuth } from '../middleware/auth';
import { deleteCase } from '../controllers/case.controller';
import { createCase, deleteCase } from '../controllers/case.controller';
const router = Router();
router.post('/', requireAuth, createCase);
router.delete('/:caseId', requireAuth, deleteCase);
export default router;