powr-sdk-api 2.0.5 → 2.0.6

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.
@@ -25,7 +25,7 @@ const upload = multer({
25
25
  router.get("/powrform", async (req, res) => {
26
26
  const projectId = req.query.projectId;
27
27
  try {
28
- const db = getDb();
28
+ const db = await getDb();
29
29
  const collection = db.collection("powrForm");
30
30
  const forms = await collection.find({
31
31
  projectId
@@ -60,7 +60,7 @@ router.get('/:formName', async (req, res) => {
60
60
  message: 'projectId is required as query parameter'
61
61
  });
62
62
  }
63
- const db = getDb();
63
+ const db = await getDb();
64
64
  const collection = db.collection("powrForm");
65
65
  const formData = await collection.findOne({
66
66
  formName,
@@ -99,7 +99,7 @@ router.post('/studentform', async (req, res) => {
99
99
  email,
100
100
  ...otherFormFields
101
101
  } = formData;
102
- const db = getDb();
102
+ const db = await getDb();
103
103
  const studentsFormCollection = db.collection('studentsForm');
104
104
  const existingForm = await studentsFormCollection.findOne({
105
105
  whatsapp: whatsapp,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "powr-sdk-api",
3
- "version": "2.0.5",
3
+ "version": "2.0.6",
4
4
  "description": "Shared API core library for PowrStack projects",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",