fix datasources not getting updated correctly

This commit is contained in:
Keviin Åberg Kultalahti 2021-08-26 22:01:24 +02:00
parent b14bda8610
commit cf9a8c3805
1 changed files with 2 additions and 2 deletions

View File

@ -60,8 +60,8 @@ exports.buildSchemaFromDb = async function (ctx) {
exports.update = async function (ctx) { exports.update = async function (ctx) {
const db = new CouchDB(ctx.appId) const db = new CouchDB(ctx.appId)
const datasourceId = ctx.params.datasourceId const datasourceId = ctx.params.datasourceId
const datasource = await db.get(datasourceId) let datasource = await db.get(datasourceId)
datasource.name = ctx.request.body.name datasource = { ...datasource, ...ctx.request.body }
const response = await db.put(datasource) const response = await db.put(datasource)
datasource._rev = response.rev datasource._rev = response.rev