From 9cee0f228951ae73ec5831ef369ed84b0622d08c Mon Sep 17 00:00:00 2001 From: Sameer Dev Date: Mon, 13 Jan 2025 08:09:05 +0000 Subject: [PATCH] code update recorded at: 13/01/25 08:09:05 --- handler.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/handler.js b/handler.js index 8c7ad3a..48f64da 100644 --- a/handler.js +++ b/handler.js @@ -30,7 +30,7 @@ const validateRequestBody = ({ command, key, secretData }) => { // Throw error if any validation fails if (errors.length) { - msg = `Validation errors: ${errors.join(' ')}` + var msg = `Validation errors: ${errors.join(' ')}` console.log(msg) throw new Error(msg); } @@ -167,7 +167,7 @@ export const handler = async (req, res) => { if (command === "GET") { result = await client.get(key); } else if (command === "SET") { - result = await client.set(key, value, "EX", ttl); + result = await client.set(key, value, "EX", ttl || 0); } console.log('Command executed successfully:', JSON.stringify(result));