Skip to content

Commit

Permalink
chore: 🎨 Changed the table name in delete item to use the table from …
Browse files Browse the repository at this point in the history
…dynamodb client

Signed-off-by: Thushar M Prakash <thushar@arezlabs.com>
Signed-off-by: Thushar M Prakash <thushar.prakash@oolio.com>
  • Loading branch information
thusharprakash committed Jan 4, 2024
1 parent bbd199d commit cedef7f
Showing 1 changed file with 1 addition and 3 deletions.
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,
Key: map[string]types.AttributeValue{
"pk": &types.AttributeValueMemberS{Value: pk},
"sk": &types.AttributeValueMemberS{Value: sk},
Expand Down

0 comments on commit cedef7f

Please sign in to comment.