status
This commit is contained in:
parent
79f0c312e1
commit
3263b9d599
@ -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)
|
||||||
|
@ -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 }
|
||||||
|
14
server.js
14
server.js
@ -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
BIN
tmp/tmp-1-1659956023678
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.7 MiB |
Loading…
Reference in New Issue
Block a user