This commit is contained in:
pawan-dot 2022-08-08 16:32:05 +05:30
parent 79f0c312e1
commit 3263b9d599
4 changed files with 9 additions and 9 deletions

View File

@ -207,7 +207,7 @@ export const setStatus = async (req, res) => {
try { try {
const id = req.params.id; const id = req.params.id;
if (!id) return res.status(400).json({ message: 'id is required' }); if (!id) return res.status(400).json({ message: 'id is required' });
// console.log(id)
const directory = await directoryModel.findById(req.params.id) const directory = await directoryModel.findById(req.params.id)
if (!directory) if (!directory)

View File

@ -70,7 +70,7 @@ const directorySchema = new mongoose.Schema(
userId: { userId: {
type: mongoose.Schema.ObjectId, type: mongoose.Schema.ObjectId,
ref: "User", ref: "User",
required: true, // required: true,
}, },
}, { timestamps: true } }, { timestamps: true }

View File

@ -36,11 +36,11 @@ const server = app.listen(process.env.PORT, () => {
// Unhandled Promise Rejection // Unhandled Promise Rejection
process.on("unhandledRejection", (err) => { // process.on("unhandledRejection", (err) => {
console.log(`Error: ${err.message}`); // console.log(`Error: ${err.message}`);
console.log(`Shutting down the server due to Unhandled Promise Rejection`); // console.log(`Shutting down the server due to Unhandled Promise Rejection`);
server.close(() => { // server.close(() => {
process.exit(1); // process.exit(1);
}); // });
}); // });

BIN
tmp/tmp-1-1659956023678 Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 MiB