Skip to content

Commit

Permalink
feat(amplify-appsync-simulator): cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
alichherawalla committed Jul 13, 2021
1 parent 0ae767d commit b8d7b53
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions packages/amplify-appsync-simulator/src/velocity/util/rds.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,15 @@ export const rds = {
toJsonString: rdsObject => {
try {
rdsObject = JSON.parse(rdsObject);
const rdsJson = (rdsObject?.sqlStatementResults || []).map(statement => {
return (statement?.records || []).map(record => {
const rdsJson = (rdsObject?.sqlStatementResults || []).map(statement =>
(statement?.records || []).map(record => {
const result = {};
record.forEach((row, index) => {
result[statement.columnMetadata[index].name] = Object.values(row)[0];
});

return result;
});
});
}),
);
return JSON.stringify(rdsJson);
} catch {
return '';
Expand Down

0 comments on commit b8d7b53

Please sign in to comment.