Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const params = {
- TableName: process.env.DYNAMODB_TABLE,
- Key: {
- id: event.pathParameters.id,
- },
- ExpressionAttributeNames: {
- '#todo_text': 'text',
- },
- ExpressionAttributeValues: {
- ':text': data.text,
- ':checked': data.checked,
- ':updatedAt': timestamp,
- },
- UpdateExpression: 'SET #todo_text = :text, checked = :checked, updatedAt = :updatedAt',
- ReturnValues: 'ALL_NEW',
- };
- const params = {
- TableName: process.env.DYNAMODB_TABLE,
- Key: {
- id: event.pathParameters.id,
- },
- ExpressionAttributeNames: {
- '#user_name': 'name',
- },
- ExpressionAttributeValues: {
- ':name': data.name,
- ':email': data.email,
- ':username': data.username,
- ':password': data.password,
- ':checked': data.checked,
- ':updatedAt': timestamp,
- },
- UpdateExpression: 'SET #user_name = :name, email = :email, username = :username, password = :password, checked = :checked, updatedAt = :updatedAt',
- ReturnValues: 'ALL_NEW',
- };
- $ cat test/user-1.json
- {
- "name": "Bob",
- "email": "bob@example.com",
- "username": "bob",
- "password": "adfdsfdsf",
- "checked": false
- }
- $ cat test/user-1.json
- {
- "name": "Bob",
- "username": "bob-1",
- "checked": false
- }
- $ curl -X PUT ${url}/${id} --data '@test/user-1.json'
- Couldn't fetch the user item.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement