date wise task show
This commit is contained in:
parent
5f76483841
commit
e712a5a6d1
@ -184,7 +184,7 @@ export const getTasksByDates = async (req, res) => {
|
||||
|
||||
// Initialize filter object
|
||||
const filter = {};
|
||||
|
||||
console.log(req.userType);
|
||||
// Determine the filter based on user type
|
||||
if (req.userType === "SalesCoOrdinator") {
|
||||
filter.taskAssignedTo = req.user._id; // Use `=` to assign values, and `===` for comparison
|
||||
@ -213,7 +213,7 @@ export const getTasksByDates = async (req, res) => {
|
||||
createdAt: { $gte: startOfDay, $lte: endOfDay },
|
||||
})
|
||||
.populate({
|
||||
path: req.userType === "SalesCoOrdinator" ? "taskAssignedTo" : "taskAssignedBy", // Change path based on user type
|
||||
path: req.userType === "SalesCoOrdinator" ? "taskAssignedBy" : "taskAssignedTo", // Change path based on user type
|
||||
select: "name mobileNumber email",
|
||||
})
|
||||
.sort({ createdAt: -1 });
|
||||
|
Loading…
Reference in New Issue
Block a user