@feardread/fear 1.1.0 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -59,22 +59,13 @@ exports.all = tryCatch(async (Model, req, res) => {
59
59
  exports.read = tryCatch(async (Model, req, res) => {
60
60
  const { id } = req.params;
61
61
 
62
- if (!id) {
62
+ if (!id || !isValidObjectId(id)) {
63
63
  return res.status(400).json({
64
64
  result: null,
65
65
  success: false,
66
- message: "Document ID is required"
66
+ message: "Invalid or Missing Document ID"
67
67
  });
68
68
  }
69
-
70
- if (!isValidObjectId(id)) {
71
- return res.status(400).json({
72
- result: null,
73
- success: false,
74
- message: "Invalid document ID format"
75
- });
76
- }
77
-
78
69
  const result = await Model.findById(id).exec();
79
70
 
80
71
  if (!result) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@feardread/fear",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {