Skip to content

Commit

Permalink
Updated the Db endpoint
Browse files Browse the repository at this point in the history
Updated the Db endpoint
  • Loading branch information
RoryConnollyLIT committed Sep 3, 2019
1 parent 891ba80 commit fcb5d73
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions controllers/docClientController.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ function createSortKey(activityType) {
// Function that controls the Get, Post and Delete operations on the db
function docClientController() {
const docClient = new AWS.DynamoDB.DocumentClient();
const table = 'code-challenge-203';
const table = 'DogCollarData';
const handle = handleResponse();
const queryObj = {};

Expand Down Expand Up @@ -109,7 +109,7 @@ function docClientController() {
}

const params = {
TableName: 'code-challenge-203',
TableName: 'DogCollarData',
Item: request
};

Expand Down
2 changes: 1 addition & 1 deletion controllers/scanController.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const handleResponse = require('./handleResponse');
// a controller function for all the scan actions
function scanController() {
const docClient = new AWS.DynamoDB.DocumentClient();
const table = 'code-challenge-203';
const table = 'DogCollarData';
const handle = handleResponse();
const queryObj = {};

Expand Down
4 changes: 2 additions & 2 deletions tableSetup/loadTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ AWS.config.update({
// Can be run in the terminal by typing 'node loadTable'
const docClient = new AWS.DynamoDB.DocumentClient();
// eslint-disable-next-line no-console
console.log('Importing collar data into DynamoDB. Please wait.');
console.log('Importing collar data into DynamoDB table DogCollarData. Please wait.');

const mockData = JSON.parse(fs.readFileSync('mockData.json', 'utf8'));
mockData.forEach((response) => {
const params = {
TableName: 'code-challenge-203',
TableName: 'DogCollarData',
Item: {
partitionKey: response.partitionKey,
sortKey: response.sortKey,
Expand Down

0 comments on commit fcb5d73

Please sign in to comment.