powr-sdk-api 3.1.0 → 3.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.
@@ -85,9 +85,7 @@ router.post("/toggle", async (req, res) => {
85
85
 
86
86
  // Get all functions entries
87
87
  router.get('/', async (req, res) => {
88
- const {
89
- projectId
90
- } = req.query;
88
+ const projectId = req.projectId;
91
89
  try {
92
90
  const query = {
93
91
  projectId
@@ -116,9 +114,7 @@ router.get('/', async (req, res) => {
116
114
  // Create a new function
117
115
  router.post('/', async (req, res) => {
118
116
  try {
119
- const {
120
- projectId
121
- } = req.query;
117
+ const projectId = req.projectId;
122
118
  if (!projectId) {
123
119
  return res.status(400).json({
124
120
  success: false,
@@ -162,9 +158,7 @@ router.put('/:function', async (req, res) => {
162
158
  const {
163
159
  code
164
160
  } = req.body;
165
- const {
166
- projectId
167
- } = req.query;
161
+ const projectId = req.projectId;
168
162
  if (!projectId) {
169
163
  return res.status(400).json({
170
164
  success: false,
@@ -227,9 +221,7 @@ router.post("/:function", async (req, res) => {
227
221
  const {
228
222
  function: functionName
229
223
  } = req.params;
230
- const {
231
- projectId
232
- } = req.query;
224
+ const projectId = req.projectId;
233
225
  if (!projectId) {
234
226
  return res.status(400).json({
235
227
  success: false,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "powr-sdk-api",
3
- "version": "3.1.0",
3
+ "version": "3.1.1",
4
4
  "description": "Shared API core library for PowrStack projects",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",