1
0
Fork 0
mirror of synced 2024-06-30 20:10:54 +12:00

changed "master" databse to "clientAppLookup"

This commit is contained in:
Michael Shanks 2020-06-11 10:12:01 +01:00
parent 735d9c4475
commit 108fa4ca13
5 changed files with 6 additions and 6 deletions

View file

@ -36,7 +36,7 @@ exports.create = async function(ctx) {
}
const appId = newid()
// insert an appId -> clientId lookup
const masterDb = new CouchDB("master")
const masterDb = new CouchDB("clientAppLookup")
await masterDb.put({
_id: appId,
clientId,
@ -113,7 +113,7 @@ const createEmptyAppPackage = async (ctx, app) => {
}
const lookupClientId = async appId => {
const masterDb = new CouchDB("master")
const masterDb = new CouchDB("clientAppLookup")
const { clientId } = await masterDb.get(appId)
return clientId
}

View file

@ -9,7 +9,7 @@ exports.authenticate = async ctx => {
if (!username) ctx.throw(400, "Username Required.")
if (!password) ctx.throw(400, "Password Required")
const masterDb = new CouchDB("master")
const masterDb = new CouchDB("clientAppLookup")
const { clientId } = await masterDb.get(ctx.params.appId)
if (!clientId) {

View file

@ -7,7 +7,7 @@ const {
} = require("../../utilities/budibaseDir")
exports.fetchAppComponentDefinitions = async function(ctx) {
const masterDb = new CouchDB("master")
const masterDb = new CouchDB("clientAppLookup")
const { clientId } = await masterDb.get(ctx.params.appId)
const db = new CouchDB(ClientDb.name(clientId))
const app = await db.get(ctx.params.appId)

View file

@ -8,7 +8,7 @@ exports.create = async function(ctx) {
const instanceId = `inst_${appShortId}_${newid()}`
const { applicationId } = ctx.params
const masterDb = new CouchDB("master")
const masterDb = new CouchDB("clientAppLookup")
const { clientId } = await masterDb.get(applicationId)
const db = new CouchDB(instanceId)

View file

@ -41,7 +41,7 @@ exports.create = async function(ctx) {
const response = await database.post(user)
const masterDb = new CouchDB("master")
const masterDb = new CouchDB("clientAppLookup")
const { clientId } = await masterDb.get(appId)
// the clientDB needs to store a map of users against the app