powr-sdk-api 3.1.1 → 3.1.3

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.
@@ -9,9 +9,7 @@ const {
9
9
  ObjectId
10
10
  } = require("mongodb");
11
11
  router.get('/', async (req, res) => {
12
- const {
13
- projectId
14
- } = req.query;
12
+ const projectId = req.projectId;
15
13
  try {
16
14
  const query = {
17
15
  projectId
@@ -40,9 +38,7 @@ router.get('/:invoiceId', async (req, res) => {
40
38
  const {
41
39
  invoiceId
42
40
  } = req.params;
43
- const {
44
- projectId
45
- } = req.query;
41
+ const projectId = req.projectId;
46
42
  try {
47
43
  if (!projectId) {
48
44
  return res.status(400).json({
@@ -69,9 +65,7 @@ router.get('/:invoiceId', async (req, res) => {
69
65
  }
70
66
  });
71
67
  router.post('/', async (req, res) => {
72
- const {
73
- projectId
74
- } = req.query;
68
+ const projectId = req.projectId;
75
69
  const {
76
70
  invoiceNumber,
77
71
  dateOfIssue,
@@ -124,9 +118,7 @@ router.put('/:invoiceId', async (req, res) => {
124
118
  const {
125
119
  invoiceId
126
120
  } = req.params;
127
- const {
128
- projectId
129
- } = req.query;
121
+ const projectId = req.projectId;
130
122
  if (!projectId) {
131
123
  return res.status(400).json({
132
124
  success: false,
@@ -9,9 +9,7 @@ const {
9
9
 
10
10
  // Get notifications
11
11
  router.get('/', async (req, res) => {
12
- const {
13
- projectId
14
- } = req.query;
12
+ const projectId = req.projectId;
15
13
  try {
16
14
  const query = {
17
15
  projectId
@@ -44,12 +42,12 @@ router.get('/', async (req, res) => {
44
42
  // Send notification
45
43
  router.post('/', async (req, res) => {
46
44
  const {
47
- projectId,
48
45
  title,
49
46
  description,
50
47
  filter,
51
48
  imgurl
52
49
  } = req.body;
50
+ const projectId = req.projectId;
53
51
  if (typeof filter !== 'object' || Array.isArray(filter) || filter === null) {
54
52
  return res.status(400).json({
55
53
  success: false,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "powr-sdk-api",
3
- "version": "3.1.1",
3
+ "version": "3.1.3",
4
4
  "description": "Shared API core library for PowrStack projects",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",