-
Notifications
You must be signed in to change notification settings - Fork 37
Open
Description
I recently updated my api app to use the updated logic in the libs folder of the demo api but now I'm transitioning my app to the ext format to deploy on seed but the ext app hasn't been updated with the new logic.
Demo API Version
import AWS from "aws-sdk";
const client = new AWS.DynamoDB.DocumentClient();
export default {
get : (params) => client.get(params).promise(),
put : (params) => client.put(params).promise(),
query : (params) => client.query(params).promise(),
update: (params) => client.update(params).promise(),
delete: (params) => client.delete(params).promise(),
};
EXT version
import AWS from "./aws-sdk";
import config from "../config";
const dynamoDb = new AWS.DynamoDB.DocumentClient();
export function call(action, params) {
// Parameterize table names with stage name
return dynamoDb[action]({
...params,
TableName: `${config.resourcesStage}-${params.TableName}`
}).promise();
}
Looks like we just need to spread the params into the table name stage.
get: (params) => client.get({
...params,
TableName: `${config.resourcesStage}-${params.TableName}`
}).promise()
Metadata
Metadata
Assignees
Labels
No labels