Skip to content

Commit

Permalink
Test call to WSGW
Browse files Browse the repository at this point in the history
  • Loading branch information
Ronaldo Macapobre committed Nov 25, 2024
1 parent 52cde11 commit 081f498
Showing 1 changed file with 33 additions and 21 deletions.
54 changes: 33 additions & 21 deletions aws/lambdas/locations/get-rooms/index.ts
Original file line number Diff line number Diff line change
@@ -1,28 +1,40 @@
import { APIGatewayEvent, APIGatewayProxyResult, Context } from "aws-lambda"
import { APIGatewayEvent, APIGatewayProxyResult, Context } from "aws-lambda";
import HttpService from "../../../services/httpService";

export const handler = async (
event: APIGatewayEvent,
context: Context
): Promise<APIGatewayProxyResult> => {
console.log(event, context)
console.log(event, context);

return {
statusCode: 200,
body: JSON.stringify([
{
codeType: "COURT_ROOMS",
code: "00",
shortDesc: "CRT",
longDesc: "NIDD-00",
flex: "NIDD"
},
{
codeType: "COURT_ROOMS",
code: "001",
shortDesc: "CRT",
longDesc: "1031-001",
flex: "1031"
}
])
try {
const http = new HttpService();
await http.init("https://wsgw.dev.jag.gov.bc.ca/dev");
const result = await http.get("/TestService");

console.log(result);

return {
statusCode: 200,
body: JSON.stringify([
{
codeType: "COURT_ROOMS",
code: "00",
shortDesc: "CRT",
longDesc: "NIDD-00",
flex: "NIDD",
},
{
codeType: "COURT_ROOMS",
code: "001",
shortDesc: "CRT",
longDesc: "1031-001",
flex: "1031",
},
]),
};
} catch (error) {
console.error(error);
throw error;
}
}
};

0 comments on commit 081f498

Please sign in to comment.