Skip to content

Commit

Permalink
Get Events by Event_Name
Browse files Browse the repository at this point in the history
  • Loading branch information
HDGoldi committed Mar 29, 2020
1 parent ac77e4a commit 28c9778
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions serverless-backend/particle-backend/handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,15 @@ module.exports.events = async event => {
if (event.httpMethod === 'OPTIONS') {
return processResponse(IS_CORS);
}
const event_name = event.pathParameters.event_name;
let params = {
TableName: TABLE_NAME,
FilterExpression: "#ev = :Roll",
FilterExpression: "#01 = :02",
ExpressionAttributeNames: {
"#ev": "event"
"#01": "event"
},
ExpressionAttributeValues: {
":Roll": "Rollade_1"
":02": event_name
}
}
try {
Expand Down
2 changes: 1 addition & 1 deletion serverless-backend/particle-backend/serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ functions:
description: Getting events from Particle.io from DynamoDB
events:
- http:
path: events
path: events/{event_name}
method: get
cors: true
private: true
Expand Down

0 comments on commit 28c9778

Please sign in to comment.