This commit is contained in:
Killer Boss Original 2022-07-05 15:20:23 +02:00 committed by GitHub
parent 7b0eef8d1a
commit 6d9eeaad46
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -93,5 +93,30 @@ async function set(request, response) {
} }
} }
response.send(reply);
}
// Set a db variable
app.get('/api/:auth/database/:element/remove', remove);
async function remove(request, response) {
var token = request.params.auth;
var element = request.params.element;
var data = request.params.data;
set = 'remove '+element
authenticate(token, set)
await db.set(element, response, data)
const res = await db.delete(element)
if(res) {
var reply = res;
} else {
var reply = {
status:"Not Found"
}
}
response.send(reply); response.send(reply);
} }