diff --git a/lambda-handler/archive-zettel-handler/main.go b/lambda-handler/archive-zettel-handler/main.go index ea7e24a..8e50d83 100644 --- a/lambda-handler/archive-zettel-handler/main.go +++ b/lambda-handler/archive-zettel-handler/main.go @@ -118,7 +118,7 @@ func handleRequest(ctx context.Context, request events.APIGatewayProxyRequest) ( log.Fatalf("Got error calling PutItem: %s", err) } - result, err := svc.GetItem(&dynamodb.GetItemInput{ + user_config, err := svc.GetItem(&dynamodb.GetItemInput{ TableName: aws.String("tnn-UserConfig"), Key: map[string]*dynamodb.AttributeValue{ "id": { @@ -126,11 +126,12 @@ func handleRequest(ctx context.Context, request events.APIGatewayProxyRequest) ( }, }, }) + if err != nil { log.Fatalf("Got error calling GetItem: %s", err) } - if result.Item != nil { + if user_config.Item != nil { qsvc := sqs.New(sess) m := SqsMessage{document.UserId, document.ID} diff --git a/lambda-handler/save-document-handler/main.go b/lambda-handler/save-document-handler/main.go index 846f7c8..a122d05 100644 --- a/lambda-handler/save-document-handler/main.go +++ b/lambda-handler/save-document-handler/main.go @@ -77,7 +77,7 @@ func handleRequest(ctx context.Context, event events.SQSEvent) { log.Fatalf("Got error calling PutItem: %s", err) } - result, err := svc.GetItem(&dynamodb.GetItemInput{ + user_config, err := svc.GetItem(&dynamodb.GetItemInput{ TableName: aws.String("tnn-UserConfig"), Key: map[string]*dynamodb.AttributeValue{ "id": { @@ -85,11 +85,12 @@ func handleRequest(ctx context.Context, event events.SQSEvent) { }, }, }) + if err != nil { log.Fatalf("Got error calling GetItem: %s", err) } - if result.Item != nil { + if user_config.Item != nil { log.Printf("Recreating index for document %s", item.Body.Document.ID) qsvc := sqs.New(sess)