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:
@@ -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);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user