bugfix, create client db not passing config

This commit is contained in:
Michael Shanks 2020-04-24 10:03:31 +01:00
parent 1db38ee4d6
commit c7bebf3e48
2 changed files with 6 additions and 4 deletions

View File

@ -1,9 +1,9 @@
const CouchDb = require(".") const CouchDb = require(".")
module.exports = async clientId => { module.exports = async (config, clientId) => {
await CouchDb.db.create(clientId) await CouchDb.db.create(`client-${clientId}`)
const db = CouchDb.db.use(clientId) const db = CouchDb(config).db.use(`client-${clientId}`)
await db.insert( await db.insert(
{ {

View File

@ -1,5 +1,7 @@
const couchdb = require("../../../../db")({ database: "couch" }) const couchdb = require("../../../../db")({ database: "couch" })
const createClientDb = require("../../../../db/createClientDb") const createClientDb = require("../../../../db/createClientDb")({
database: "couch",
})
const CLIENT_DB_ID = "client-testing"; const CLIENT_DB_ID = "client-testing";
const TEST_APP_ID = "test-app"; const TEST_APP_ID = "test-app";