Fix build.
This commit is contained in:
parent
e4b0330866
commit
b4669b32f0
|
@ -1,7 +1,7 @@
|
||||||
import fetch from "node-fetch"
|
import fetch from "node-fetch"
|
||||||
import env from "../../environment"
|
import env from "../../environment"
|
||||||
import { checkSlashesInUrl } from "../../utilities"
|
import { checkSlashesInUrl } from "../../utilities"
|
||||||
import { request } from "../../utilities/workerRequests"
|
import { createRequest } from "../../utilities/workerRequests"
|
||||||
import { clearLock as redisClearLock } from "../../utilities/redis"
|
import { clearLock as redisClearLock } from "../../utilities/redis"
|
||||||
import { DocumentType } from "../../db/utils"
|
import { DocumentType } from "../../db/utils"
|
||||||
import {
|
import {
|
||||||
|
@ -13,14 +13,19 @@ import {
|
||||||
} from "@budibase/backend-core"
|
} from "@budibase/backend-core"
|
||||||
import { App } from "@budibase/types"
|
import { App } from "@budibase/types"
|
||||||
|
|
||||||
async function redirect(ctx: any, method: string, path: string = "global") {
|
async function redirect(
|
||||||
|
ctx: any,
|
||||||
|
method: "GET" | "POST" | "DELETE",
|
||||||
|
path: string = "global"
|
||||||
|
) {
|
||||||
const { devPath } = ctx.params
|
const { devPath } = ctx.params
|
||||||
const queryString = ctx.originalUrl.split("?")[1] || ""
|
const queryString = ctx.originalUrl.split("?")[1] || ""
|
||||||
const response = await fetch(
|
const response = await fetch(
|
||||||
checkSlashesInUrl(
|
checkSlashesInUrl(
|
||||||
`${env.WORKER_URL}/api/${path}/${devPath}?${queryString}`
|
`${env.WORKER_URL}/api/${path}/${devPath}?${queryString}`
|
||||||
),
|
),
|
||||||
request(ctx, {
|
createRequest({
|
||||||
|
ctx,
|
||||||
method,
|
method,
|
||||||
body: ctx.request.body,
|
body: ctx.request.body,
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue