Skip to content

Commit 8f2bced

Browse files
committed
chore: run linter
1 parent c28fdde commit 8f2bced

File tree

4 files changed

+17
-14
lines changed

4 files changed

+17
-14
lines changed

javascriptv3/example_code/cross-services/aurora-serverless-app/src/handlers/post-items-handler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const postItemsHandler: Handler = {
2020
const command = buildStatementCommand(
2121
`insert into items (iditem, description, guide, status, username, archived)
2222
values ("${uuidv4()}", ":description", ":guide", ":status", ":name", 0)`,
23-
values
23+
values,
2424
);
2525
await rdsDataClient.send(command);
2626
res.status(200).send({});

javascriptv3/example_code/cross-services/aurora-serverless-app/src/handlers/put-items-archive-handler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const putItemsArchiveHandler: Handler = {
1616
`update items
1717
set archived = 1
1818
where iditem = ":itemId"`,
19-
values
19+
values,
2020
);
2121

2222
await rdsDataClient.send(command);

javascriptv3/example_code/cross-services/aurora-serverless-app/src/statement-commands/command-helper.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,16 @@
33
import { ExecuteStatementCommand } from "@aws-sdk/client-rds-data";
44
import env from "../../env.json" with { type: "json" };
55

6-
const buildStatementCommand = (sql: string, parameters?: { [key: string]: { [key: string]: unknown}}) => {
6+
const buildStatementCommand = (
7+
sql: string,
8+
parameters?: { [key: string]: { [key: string]: unknown } },
9+
) => {
710
return new ExecuteStatementCommand({
811
resourceArn: env.CLUSTER_ARN,
912
secretArn: env.SECRET_ARN,
1013
database: env.DB_NAME,
1114
sql,
12-
[parameters ? "parameters" : ""]: [parameters]
15+
[parameters ? "parameters" : ""]: [parameters],
1316
});
1417
};
1518

javascriptv3/example_code/cross-services/aurora-serverless-app/tests/command-helper.unit.test.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ describe("command-helper", () => {
1212
expect(command.input.sql).toBe(sql);
1313
});
1414
});
15-
it("should create an ExecuteStatementCommand with the provided SQL statement and parameters", () => {
16-
const sql = "select * from some_table where id = :id";
17-
const parameters = {
18-
id: { StringValue: "123" },
19-
};
20-
const command = buildStatementCommand(sql, parameters);
21-
expect(command.constructor.name).toBe("ExecuteStatementCommand");
22-
expect(command.input.sql).toBe(sql);
23-
expect(command.input.parameters).toEqual([parameters]);
24-
});
15+
it("should create an ExecuteStatementCommand with the provided SQL statement and parameters", () => {
16+
const sql = "select * from some_table where id = :id";
17+
const parameters = {
18+
id: { StringValue: "123" },
19+
};
20+
const command = buildStatementCommand(sql, parameters);
21+
expect(command.constructor.name).toBe("ExecuteStatementCommand");
22+
expect(command.input.sql).toBe(sql);
23+
expect(command.input.parameters).toEqual([parameters]);
24+
});
2525
});

0 commit comments

Comments
 (0)