Skip to content

Commit

Permalink
final commit for now
Browse files Browse the repository at this point in the history
  • Loading branch information
dubwub committed Jan 17, 2025
1 parent 3bc2a79 commit 81e315f
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions servers/fdr-deploy/getdocs-lambda/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,10 +175,10 @@ export const handler: APIGatewayProxyHandler = async (event) => {
// console.log("Connected to RDS");

const query = `
SELECT url, docsDefinition
FROM Docs
WHERE url = $1
`;
SELECT url, docsDefinition
FROM Docs
WHERE url = $1
`;

const result = await client.query<DocumentData>(query, [parsedUrl]);
// console.log("result", result);
Expand All @@ -190,8 +190,6 @@ export const handler: APIGatewayProxyHandler = async (event) => {
};
}

// console.log("found result")

return {
statusCode: 200,
body: JSON.stringify(result.rows[0]),
Expand All @@ -213,12 +211,12 @@ export const handler: APIGatewayProxyHandler = async (event) => {
}
} catch (error) {
console.error("Error:", error);
return {
statusCode: 500,
body: JSON.stringify({ body: "Error connecting to Redis" }),
};
}
} else {
throw new Error("Authorization header was not specified");
}
return {
statusCode: 400,
body: JSON.stringify({ error: "bad request" }),
};
};

0 comments on commit 81e315f

Please sign in to comment.