I get a code response 200 successful
but a null json message on Postman
Data is not created in DynamoDB. This is my lambda:
exports.handler = async (event, context, callback) => { const id = replaceAll(event.queryStringParameters.authorId, " ", "-").toLowerCase(); const params = { Item: { id: { S: id }, title: { S: event.queryStringParameters.title }, watchHref: { S: event.queryStringParameters.watchHref }, authorId: { S: event.queryStringParameters.authorId }, length: { S: event.queryStringParameters.length }, category: { S: event.queryStringParameters.category } }, TableName: "todos" }; // console.log("@@@@@@@@@@@ ID " + params.Item.id.S + ""); // console.log("@@@@@@@@@@@ Title " + params.Item.title.S + ""); // console.log("@@@@@@@@@@@ Title " + params.Item.watchHref.S + ""); // console.log("@@@@@@@@@@@ Title " + params.Item.authorId.S + ""); // console.log("@@@@@@@@@@@ Title " + params.Item.length.S + ""); // console.log("@@@@@@@@@@@ Title " + params.Item.category.S + ""); dynamodb.putItem(params, function (err, data) { console.log("@@@@@@@@@@@ ID " + params.Item.id.S + ""); if (err) { console.log("@@@@@@@@@@@ ERROR" + err); callback(err); } else { console.log("@@@@@@@@@@ INSIDE ELSE"); callback(null, { id: params.Item.id.S, title: params.Item.title.S, watchHref: params.Item.watchHref.S, authorId: params.Item.authorId.S, length: params.Item.length.S, category: params.Item.category.S }); } }); };
What am I doing wrong? I folowed the same principles that on the documentation.
As a reference, I'm doing it with HTTP API gateway proxy integration and this is my table:

replaceAll? should it beevent.queryStringParameters.authorId.replace(" ", "-").toLowerCase();