notification about emails in company card
This commit is contained in:
@@ -69,6 +69,25 @@ export const getCompanyEmailThreads = async (req, res) => {
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Get unread email counts grouped by company for current user
|
||||
* GET /api/companies/email-unread
|
||||
*/
|
||||
export const getCompanyUnreadCounts = async (req, res) => {
|
||||
try {
|
||||
const userId = req.userId;
|
||||
const counts = await companyEmailService.getCompanyUnreadCounts(userId);
|
||||
|
||||
res.status(200).json({
|
||||
success: true,
|
||||
data: counts,
|
||||
});
|
||||
} catch (error) {
|
||||
const errorResponse = formatErrorResponse(error, process.env.NODE_ENV === 'development');
|
||||
res.status(error.statusCode || 500).json(errorResponse);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Get company with relations (projects, todos, notes)
|
||||
* GET /api/companies/:companyId/details
|
||||
|
||||
Reference in New Issue
Block a user