feat: Add notes search endpoint for enhanced global search

- Add searchNotes service function with company/project info
- Add /notes/search endpoint for searching notes content
- Returns matching notes with linked company/project names

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
richardtekula
2026-01-22 07:49:10 +01:00
parent 826fd467bc
commit 284d905d18
3 changed files with 52 additions and 0 deletions

View File

@@ -167,3 +167,23 @@ export const markReminderSent = async (req, res, next) => {
next(error);
}
};
/**
* Search notes with company and project info
* GET /api/notes/search?q=searchTerm
*/
export const searchNotes = async (req, res, next) => {
try {
const { q } = req.query;
const results = await noteService.searchNotes(q);
res.status(200).json({
success: true,
count: results.length,
data: results,
});
} catch (error) {
next(error);
}
};