remove references to module exports
This commit is contained in:
parent
07f2f66b04
commit
19a2049475
|
@ -215,7 +215,7 @@ export const queryView = async <T>(
|
||||||
const createFunc = CreateFuncByName[viewName]
|
const createFunc = CreateFuncByName[viewName]
|
||||||
await removeDeprecated(db, viewName)
|
await removeDeprecated(db, viewName)
|
||||||
await createFunc()
|
await createFunc()
|
||||||
return exports.queryView(viewName, params, db, CreateFuncByName)
|
return queryView(viewName, params, db, CreateFuncByName, opts)
|
||||||
} else {
|
} else {
|
||||||
throw err
|
throw err
|
||||||
}
|
}
|
||||||
|
@ -228,14 +228,14 @@ export const queryPlatformView = async <T>(
|
||||||
opts?: QueryViewOptions
|
opts?: QueryViewOptions
|
||||||
): Promise<T[] | T | undefined> => {
|
): Promise<T[] | T | undefined> => {
|
||||||
const CreateFuncByName = {
|
const CreateFuncByName = {
|
||||||
[ViewName.ACCOUNT_BY_EMAIL]: exports.createAccountEmailView,
|
[ViewName.ACCOUNT_BY_EMAIL]: createAccountEmailView,
|
||||||
[ViewName.PLATFORM_USERS_LOWERCASE]: exports.createPlatformUserView,
|
[ViewName.PLATFORM_USERS_LOWERCASE]: createPlatformUserView,
|
||||||
}
|
}
|
||||||
|
|
||||||
return doWithDB(
|
return doWithDB(
|
||||||
StaticDatabases.PLATFORM_INFO.name,
|
StaticDatabases.PLATFORM_INFO.name,
|
||||||
async (db: PouchDB.Database) => {
|
async (db: PouchDB.Database) => {
|
||||||
return exports.queryView(viewName, params, db, CreateFuncByName, opts)
|
return queryView(viewName, params, db, CreateFuncByName, opts)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -247,14 +247,14 @@ export const queryGlobalView = async <T>(
|
||||||
opts?: QueryViewOptions
|
opts?: QueryViewOptions
|
||||||
): Promise<T[] | T | undefined> => {
|
): Promise<T[] | T | undefined> => {
|
||||||
const CreateFuncByName = {
|
const CreateFuncByName = {
|
||||||
[ViewName.USER_BY_EMAIL]: exports.createNewUserEmailView,
|
[ViewName.USER_BY_EMAIL]: createNewUserEmailView,
|
||||||
[ViewName.BY_API_KEY]: exports.createApiKeyView,
|
[ViewName.BY_API_KEY]: createApiKeyView,
|
||||||
[ViewName.USER_BY_BUILDERS]: exports.createUserBuildersView,
|
[ViewName.USER_BY_BUILDERS]: createUserBuildersView,
|
||||||
[ViewName.USER_BY_APP]: exports.createUserAppView,
|
[ViewName.USER_BY_APP]: createUserAppView,
|
||||||
}
|
}
|
||||||
// can pass DB in if working with something specific
|
// can pass DB in if working with something specific
|
||||||
if (!db) {
|
if (!db) {
|
||||||
db = getGlobalDB()
|
db = getGlobalDB() as PouchDB.Database
|
||||||
}
|
}
|
||||||
return exports.queryView(viewName, params, db, CreateFuncByName)
|
return queryView(viewName, params, db, CreateFuncByName)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue