From ab7793587898e5c0d7c670c2a26d2a8cc3089850 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Keviin=20=C3=85berg=20Kultalahti?= Date: Thu, 26 Aug 2021 22:01:24 +0200 Subject: [PATCH] fix datasources not getting updated correctly --- packages/server/src/api/controllers/datasource.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/server/src/api/controllers/datasource.js b/packages/server/src/api/controllers/datasource.js index df1cf7b40e..38b6e68932 100644 --- a/packages/server/src/api/controllers/datasource.js +++ b/packages/server/src/api/controllers/datasource.js @@ -60,8 +60,8 @@ exports.buildSchemaFromDb = async function (ctx) { exports.update = async function (ctx) { const db = new CouchDB(ctx.appId) const datasourceId = ctx.params.datasourceId - const datasource = await db.get(datasourceId) - datasource.name = ctx.request.body.name + let datasource = await db.get(datasourceId) + datasource = { ...datasource, ...ctx.request.body } const response = await db.put(datasource) datasource._rev = response.rev