From 15b468753798907061af259b99e8126e7373a3e0 Mon Sep 17 00:00:00 2001 From: Killer Boss Original <73131550+killerbossoriginal@users.noreply.github.com> Date: Tue, 5 Jul 2022 16:27:01 +0200 Subject: [PATCH] s --- index.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/index.js b/index.js index 80a44c9..e6271dd 100644 --- a/index.js +++ b/index.js @@ -82,9 +82,10 @@ async function searchElement(request, response) { authenticate(token, response, search) var elements = await db.get(word) + var elements = JSON.parse(elements); if(elements) { - var reply = {elements}; + var reply = elements } else { var reply = { status:"Not Found" @@ -108,8 +109,9 @@ async function set(request, response) { await db.set(element, data) const res = await db.get(element) + var res = JSON.parse(res); if(res) { - var reply = {res}; + var reply = res; } else { var reply = { status:"404-Not Found" @@ -133,10 +135,9 @@ async function remove(request, response) { await db.set(element, data) const res = await db.delete(element) + var res = JSON.parse(res); if(res) { - var reply = { - res - }; + var reply = res } else { var reply = { status:"Not Found"