Type breaking changes as any

This commit is contained in:
Adria Navarro 2023-07-18 10:49:39 +02:00
parent c4c62e5c6f
commit 1072292b9f
4 changed files with 5 additions and 5 deletions

View File

@ -159,7 +159,7 @@ export async function updateUserOAuth(userId: string, oAuthConfig: any) {
try { try {
const db = getGlobalDB() const db = getGlobalDB()
const dbUser = await db.get(userId) const dbUser = await db.get<any>(userId)
//Do not overwrite the refresh token if a valid one is not provided. //Do not overwrite the refresh token if a valid one is not provided.
if (typeof details.refreshToken !== "string") { if (typeof details.refreshToken !== "string") {

View File

@ -12,7 +12,7 @@ const EXPIRY_SECONDS = 3600
*/ */
async function populateFromDB(userId: string, tenantId: string) { async function populateFromDB(userId: string, tenantId: string) {
const db = tenancy.getTenantDB(tenantId) const db = tenancy.getTenantDB(tenantId)
const user = await db.get(userId) const user = await db.get<any>(userId)
user.budibaseAccess = true user.budibaseAccess = true
if (!env.SELF_HOSTED && !env.DISABLE_ACCOUNT_PORTAL) { if (!env.SELF_HOSTED && !env.DISABLE_ACCOUNT_PORTAL) {
const account = await accounts.getAccount(user.email) const account = await accounts.getAccount(user.email)

View File

@ -5,7 +5,7 @@ export async function createUserIndex() {
const db = getGlobalDB() const db = getGlobalDB()
let designDoc let designDoc
try { try {
designDoc = await db.get("_design/database") designDoc = await db.get<any>("_design/database")
} catch (err: any) { } catch (err: any) {
if (err.status === 404) { if (err.status === 404) {
designDoc = { _id: "_design/database" } designDoc = { _id: "_design/database" }

View File

@ -67,9 +67,9 @@ export const bulkUpdateGlobalUsers = async (users: User[]) => {
export async function getById(id: string, opts?: GetOpts): Promise<User> { export async function getById(id: string, opts?: GetOpts): Promise<User> {
const db = context.getGlobalDB() const db = context.getGlobalDB()
let user = await db.get(id) let user = await db.get<User>(id)
if (opts?.cleanup) { if (opts?.cleanup) {
user = removeUserPassword(user) user = removeUserPassword(user) as User
} }
return user return user
} }