Merge branch 'main' of https://git.cnapp.co.in/gitadmin/api
This commit is contained in:
commit
9c31ccdd7c
BIN
public/temp/tmp-1-1725944572643
Normal file
BIN
public/temp/tmp-1-1725944572643
Normal file
Binary file not shown.
After Width: | Height: | Size: 138 KiB |
BIN
public/temp/tmp-2-1725944572654
Normal file
BIN
public/temp/tmp-2-1725944572654
Normal file
Binary file not shown.
After Width: | Height: | Size: 138 KiB |
BIN
public/temp/tmp-3-1725944572665
Normal file
BIN
public/temp/tmp-3-1725944572665
Normal file
Binary file not shown.
After Width: | Height: | Size: 138 KiB |
BIN
public/temp/tmp-4-1725944572671
Normal file
BIN
public/temp/tmp-4-1725944572671
Normal file
Binary file not shown.
After Width: | Height: | Size: 138 KiB |
BIN
public/temp/tmp-5-1725944572681
Normal file
BIN
public/temp/tmp-5-1725944572681
Normal file
Binary file not shown.
After Width: | Height: | Size: 138 KiB |
BIN
public/temp/tmp-6-1725944572689
Normal file
BIN
public/temp/tmp-6-1725944572689
Normal file
Binary file not shown.
After Width: | Height: | Size: 138 KiB |
@ -54,7 +54,7 @@ const salescoordinatorSchema = new mongoose.Schema(
|
|||||||
},
|
},
|
||||||
fcm_token: {
|
fcm_token: {
|
||||||
type: String,
|
type: String,
|
||||||
unique: true,
|
default: null,
|
||||||
},
|
},
|
||||||
mappedby: {
|
mappedby: {
|
||||||
type: mongoose.Schema.Types.ObjectId,
|
type: mongoose.Schema.Types.ObjectId,
|
||||||
|
@ -138,6 +138,7 @@ export const assignTask = async (req, res) => {
|
|||||||
|
|
||||||
export const getTasksByStatus = async (req, res) => {
|
export const getTasksByStatus = async (req, res) => {
|
||||||
try {
|
try {
|
||||||
|
await updateOverdueTasks();
|
||||||
const { status } = req.params; // This should be "New", "Pending", or "Completed"
|
const { status } = req.params; // This should be "New", "Pending", or "Completed"
|
||||||
|
|
||||||
// Validate the provided status
|
// Validate the provided status
|
||||||
@ -167,6 +168,7 @@ export const getTasksByStatus = async (req, res) => {
|
|||||||
};
|
};
|
||||||
export const getAllTasksByStatus = async (req, res) => {
|
export const getAllTasksByStatus = async (req, res) => {
|
||||||
try {
|
try {
|
||||||
|
await updateOverdueTasks();
|
||||||
const { status } = req.params; // This should be "New", "Pending", or "Completed"
|
const { status } = req.params; // This should be "New", "Pending", or "Completed"
|
||||||
|
|
||||||
// Validate the provided status
|
// Validate the provided status
|
||||||
@ -201,6 +203,7 @@ export const getAllTasksByStatus = async (req, res) => {
|
|||||||
};
|
};
|
||||||
export const getTasksbytask = async (req, res) => {
|
export const getTasksbytask = async (req, res) => {
|
||||||
try {
|
try {
|
||||||
|
await updateOverdueTasks();
|
||||||
const { task } = req.params;
|
const { task } = req.params;
|
||||||
|
|
||||||
// Validate the provided status
|
// Validate the provided status
|
||||||
|
@ -54,7 +54,7 @@ const territorymanagerSchema = new mongoose.Schema(
|
|||||||
},
|
},
|
||||||
fcm_token: {
|
fcm_token: {
|
||||||
type: String,
|
type: String,
|
||||||
unique: true,
|
default: null,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{ timestamps: true }
|
{ timestamps: true }
|
||||||
|
@ -1169,7 +1169,7 @@ export const mappedbyTM = catchAsyncErrors(async (req, res, next) => {
|
|||||||
export const mappedbySC = catchAsyncErrors(async (req, res, next) => {
|
export const mappedbySC = catchAsyncErrors(async (req, res, next) => {
|
||||||
const { id } = req.params; // SalesCoOrdinator ID from URL parameters
|
const { id } = req.params; // SalesCoOrdinator ID from URL parameters
|
||||||
const { mappedbySC } = req.body; // TerritoryManager ID from request body
|
const { mappedbySC } = req.body; // TerritoryManager ID from request body
|
||||||
// console.log(id, mappedby);
|
// console.log(id, mappedbySC);
|
||||||
// Validate that the TerritoryManager ID is provided
|
// Validate that the TerritoryManager ID is provided
|
||||||
if (!mappedbySC) {
|
if (!mappedbySC) {
|
||||||
return res.status(400).json({
|
return res.status(400).json({
|
||||||
|
@ -30,7 +30,7 @@ app.get("/", (req, res) => {
|
|||||||
});
|
});
|
||||||
// }
|
// }
|
||||||
// Schedule the cron job
|
// Schedule the cron job
|
||||||
cron.schedule("10 0 * * *", updateOverdueTasks, {
|
cron.schedule("3 0 * * *", updateOverdueTasks, {
|
||||||
timezone: "Asia/Kolkata",
|
timezone: "Asia/Kolkata",
|
||||||
});
|
});
|
||||||
//<---------deployement------------->
|
//<---------deployement------------->
|
||||||
|
Loading…
Reference in New Issue
Block a user