We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6770d95 commit b9504fcCopy full SHA for b9504fc
todos/routes.js
@@ -8,7 +8,7 @@ const router = express.Router();
8
9
const dynamoDb = new AWS.DynamoDB.DocumentClient();
10
11
-const params = {
+const tableParams = {
12
TableName: process.env.DYNAMODB_TABLE
13
};
14
@@ -33,15 +33,16 @@ router
33
updateAt: timestamp
34
35
36
- const createParam = Object.assign({}, params, { Item: Item });
+ const params = Object.assign({}, tableParams, { Item: Item });
37
38
- dynamoDb.put(createParam, err => {
39
- if (err) {
40
- console.error(err);
+ dynamoDb.put(params, error => {
+ if (error) {
+ console.error(error);
41
res.status(400).send("Couldn't create todo item.");
42
+ } else {
43
+ res.send(params);
44
}
45
});
- res.send(createParam);
46
47
48
router
0 commit comments