Update src/server/api.ts
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2025-08-13 10:49:27 +02:00
parent e03d20429b
commit 3614b2d5d4

View File

@@ -76,7 +76,7 @@ export default function (server, opts, done) {
console.log(`Received ${req.body.version}, expected ${db_version+1} (-1 if expected nothing)`)
console.log(req.body)
if(db_version+1 == req.body.version || db_version == -1)
return server.level.db.put(req.params.id, req.body)
return server.level.db.put(req.params.id, JSON.stringify(req.body))
.then(_=>reply.send({ content: "ok" }))
.catch(_=>reply.code(500).send({ error: "Error with DB" }))