Some fixes after re-running server tests.
This commit is contained in:
parent
d6e9380c06
commit
3aeb6653c6
|
@ -1,6 +1,6 @@
|
|||
import * as rowController from "../row"
|
||||
import { addRev } from "./utils"
|
||||
import { Row } from "../../../definitions/common"
|
||||
import { Row } from "@budibase/types"
|
||||
import { convertBookmark } from "../../../utilities"
|
||||
|
||||
// makes sure that the user doesn't need to pass in the type, tableId or _id params for
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
const { getAppDB } = require("@budibase/backend-core/context")
|
||||
import { context } from "@budibase/backend-core"
|
||||
import { isExternalTable } from "../../../integrations/utils"
|
||||
import { APP_PREFIX, DocumentType } from "../../../db/utils"
|
||||
|
||||
|
@ -13,7 +13,7 @@ export async function addRev(
|
|||
if (body._id.startsWith(APP_PREFIX)) {
|
||||
id = DocumentType.APP_METADATA
|
||||
}
|
||||
const db = getAppDB()
|
||||
const db = context.getAppDB()
|
||||
const dbDoc = await db.get(id)
|
||||
body._rev = dbDoc._rev
|
||||
// update ID in case it is an app ID
|
||||
|
|
|
@ -12,11 +12,8 @@ import env from "../../../environment"
|
|||
// below imports don't have declaration files
|
||||
const Router = require("@koa/router")
|
||||
const { RateLimit, Stores } = require("koa2-ratelimit")
|
||||
const {
|
||||
PermissionLevel,
|
||||
PermissionType,
|
||||
} = require("@budibase/backend-core/permissions")
|
||||
const { getRedisOptions } = require("@budibase/backend-core/redis").utils
|
||||
import { redis, permissions } from "@budibase/backend-core"
|
||||
const { PermissionType, PermissionLevel } = permissions
|
||||
|
||||
const PREFIX = "/api/public/v1"
|
||||
// allow a lot more requests when in test
|
||||
|
@ -31,7 +28,7 @@ function getApiLimitPerSecond(): number {
|
|||
|
||||
let rateLimitStore: any = null
|
||||
if (!env.isTest()) {
|
||||
const REDIS_OPTS = getRedisOptions()
|
||||
const REDIS_OPTS = redis.utils.getRedisOptions()
|
||||
let options
|
||||
if (REDIS_OPTS.redisProtocolUrl) {
|
||||
// fully qualified redis URL
|
||||
|
|
|
@ -20,7 +20,7 @@ export async function getFetchResponse(fetched: any) {
|
|||
// throw added to them, so that controllers don't
|
||||
// throw a ctx.throw undefined when error occurs
|
||||
// opts can contain, body, params and version
|
||||
export async function buildCtx(
|
||||
export function buildCtx(
|
||||
appId: string,
|
||||
emitter?: EventEmitter | null,
|
||||
opts: any = {}
|
||||
|
|
Loading…
Reference in New Issue