d
This commit is contained in:
parent
eea0f46bed
commit
1e6a48e5dc
1 changed files with 6 additions and 4 deletions
10
index.js
10
index.js
|
@ -84,7 +84,7 @@ async function searchElement(request, response) {
|
||||||
var elements = await db.get(word)
|
var elements = await db.get(word)
|
||||||
|
|
||||||
if(elements) {
|
if(elements) {
|
||||||
var reply = elements;
|
var reply = {elements};
|
||||||
} else {
|
} else {
|
||||||
var reply = {
|
var reply = {
|
||||||
status:"Not Found"
|
status:"Not Found"
|
||||||
|
@ -109,10 +109,10 @@ async function set(request, response) {
|
||||||
await db.set(element, data)
|
await db.set(element, data)
|
||||||
const res = await db.get(element)
|
const res = await db.get(element)
|
||||||
if(res) {
|
if(res) {
|
||||||
var reply = res;
|
var reply = {res};
|
||||||
} else {
|
} else {
|
||||||
var reply = {
|
var reply = {
|
||||||
status:"Not Found"
|
status:"404-Not Found"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -134,7 +134,9 @@ async function remove(request, response) {
|
||||||
await db.set(element, data)
|
await db.set(element, data)
|
||||||
const res = await db.delete(element)
|
const res = await db.delete(element)
|
||||||
if(res) {
|
if(res) {
|
||||||
var reply = res;
|
var reply = {
|
||||||
|
res
|
||||||
|
};
|
||||||
} else {
|
} else {
|
||||||
var reply = {
|
var reply = {
|
||||||
status:"Not Found"
|
status:"Not Found"
|
||||||
|
|
Loading…
Reference in a new issue