status
This commit is contained in:
parent
79f0c312e1
commit
3263b9d599
@ -207,7 +207,7 @@ export const setStatus = async (req, res) => {
|
||||
try {
|
||||
const id = req.params.id;
|
||||
if (!id) return res.status(400).json({ message: 'id is required' });
|
||||
|
||||
// console.log(id)
|
||||
const directory = await directoryModel.findById(req.params.id)
|
||||
|
||||
if (!directory)
|
||||
|
@ -70,7 +70,7 @@ const directorySchema = new mongoose.Schema(
|
||||
userId: {
|
||||
type: mongoose.Schema.ObjectId,
|
||||
ref: "User",
|
||||
required: true,
|
||||
// required: true,
|
||||
},
|
||||
|
||||
}, { timestamps: true }
|
||||
|
14
server.js
14
server.js
@ -36,11 +36,11 @@ const server = app.listen(process.env.PORT, () => {
|
||||
|
||||
|
||||
// Unhandled Promise Rejection
|
||||
process.on("unhandledRejection", (err) => {
|
||||
console.log(`Error: ${err.message}`);
|
||||
console.log(`Shutting down the server due to Unhandled Promise Rejection`);
|
||||
// process.on("unhandledRejection", (err) => {
|
||||
// console.log(`Error: ${err.message}`);
|
||||
// console.log(`Shutting down the server due to Unhandled Promise Rejection`);
|
||||
|
||||
server.close(() => {
|
||||
process.exit(1);
|
||||
});
|
||||
});
|
||||
// server.close(() => {
|
||||
// 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