Browse Source
Merge pull request #2480 from Budibase/fix/datasource-updates
fix datasources not getting updated correctly
gh-pages
Kevin Åberg Kultalahti
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
2 additions and
2 deletions
-
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 |
|
|
|
|