code update recorded at: 13/01/25 08:09:05
This commit is contained in:
parent
1a11812836
commit
9cee0f2289
|
|
@ -30,7 +30,7 @@ const validateRequestBody = ({ command, key, secretData }) => {
|
||||||
|
|
||||||
// Throw error if any validation fails
|
// Throw error if any validation fails
|
||||||
if (errors.length) {
|
if (errors.length) {
|
||||||
msg = `Validation errors: ${errors.join(' ')}`
|
var msg = `Validation errors: ${errors.join(' ')}`
|
||||||
console.log(msg)
|
console.log(msg)
|
||||||
throw new Error(msg);
|
throw new Error(msg);
|
||||||
}
|
}
|
||||||
|
|
@ -167,7 +167,7 @@ export const handler = async (req, res) => {
|
||||||
if (command === "GET") {
|
if (command === "GET") {
|
||||||
result = await client.get(key);
|
result = await client.get(key);
|
||||||
} else if (command === "SET") {
|
} 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));
|
console.log('Command executed successfully:', JSON.stringify(result));
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user