Update as per changes to pro SDK.

This commit is contained in:
mike12345567 2022-07-04 11:43:18 +01:00
parent 11f1e95cc0
commit 355cb9c091
2 changed files with 4 additions and 4 deletions

View File

@ -20,7 +20,7 @@ const {
} = require("@budibase/backend-core/context")
const { events } = require("@budibase/backend-core")
const { app } = require("@budibase/backend-core/cache")
const { logs } = require("@budibase/pro")
const { automations } = require("@budibase/pro")
const { clearOldHistory } = require("../../automations/logging")
const ACTION_DEFS = removeDeprecated(actions.ACTION_DEFINITIONS)
@ -198,7 +198,7 @@ exports.logSearch = async function (ctx) {
let { automationId, status, page, startDate } = ctx.request.body
// before querying logs, make sure old logs are cleared out
await clearOldHistory()
ctx.body = await logs.automations.getLogs(
ctx.body = await automations.logs.getLogs(
startDate,
status,
automationId,

View File

@ -9,7 +9,7 @@ import { Automation } from "../../definitions/common"
import { app } from "@budibase/backend-core/cache"
import { backOff } from "../../utilities"
import * as env from "../../environment"
import { logs } from "@budibase/pro"
import { automations } from "@budibase/pro"
import { AppMetadataErrors } from "@budibase/types"
import { AutomationResults, AutomationStatus } from "@budibase/types"
@ -38,7 +38,7 @@ function getStatus(results: AutomationResults) {
export async function clearOldHistory() {
const db = getProdAppDB()
try {
const expired = await logs.automations.getExpiredLogs()
const expired = await automations.logs.getExpiredLogs()
const toDelete = expired.data.map((doc: any) => ({
_id: doc.id,
_rev: doc.value.rev,