1
0
Fork 0
mirror of synced 2024-10-03 02:27:06 +13:00

Merge pull request #2480 from Budibase/fix/datasource-updates

fix datasources not getting updated correctly
This commit is contained in:
Kevin Åberg Kultalahti 2021-08-27 09:39:39 +02:00 committed by GitHub
commit 4b2e2d3425

View file

@ -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