joye-backend-utility 4.0.3 → 4.0.4

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.
Files changed (2) hide show
  1. package/dist/database.js +1 -1
  2. package/package.json +1 -1
package/dist/database.js CHANGED
@@ -105,7 +105,7 @@ database.findOne = (model, query) => {
105
105
  return model.findOne(query);
106
106
  };
107
107
  database.findById = (model, id) => {
108
- return model.find({ _id: mongoose_1.Types.ObjectId(id) }).sort({ _id: -1 });
108
+ return model.findOne({ _id: mongoose_1.Types.ObjectId(id) }).sort({ _id: -1 });
109
109
  };
110
110
  database.create = (model, payload) => {
111
111
  return model.create(payload);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "joye-backend-utility",
3
- "version": "4.0.3",
3
+ "version": "4.0.4",
4
4
  "description": "Joye backend utility for db functions and common functions",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",