Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Changed the table name in delete item to use client tablename #8

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions delete_item.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package dynago
import (
"context"
"log"
"os"

"github.com/aws/aws-sdk-go-v2/service/dynamodb"
"github.com/aws/aws-sdk-go-v2/service/dynamodb/types"
Expand All @@ -16,11 +15,10 @@ import (
* @return true if the record was deleted, false otherwise
*/
func (t *Client) DeleteItem(ctx context.Context, pk string, sk string) error {
table := os.Getenv("DYNAMODB_TABLE")

//delete item from dynamodb
input := &dynamodb.DeleteItemInput{
TableName: &table,
TableName: &t.TableName,
shidil marked this conversation as resolved.
Show resolved Hide resolved
Key: map[string]types.AttributeValue{
"pk": &types.AttributeValueMemberS{Value: pk},
"sk": &types.AttributeValueMemberS{Value: sk},
Expand Down