1
0
Fork 0
mirror of synced 2024-07-05 22:40:39 +12:00

Respond to PR feedback.

This commit is contained in:
Sam Rose 2024-02-28 16:35:15 +00:00
parent 4ba7070ca1
commit 223a268483
No known key found for this signature in database
5 changed files with 22 additions and 4 deletions

View file

@ -20,12 +20,12 @@ import {
AutomationActionStepId,
AutomationResults,
UserCtx,
DeleteAutomationResponse,
} from "@budibase/types"
import { getActionDefinitions as actionDefs } from "../../automations/actions"
import sdk from "../../sdk"
import { builderSocket } from "../../websockets"
import env from "../../environment"
import { DocumentDestroyResponse } from "@budibase/nano"
async function getActionDefinitions() {
return removeDeprecated(await actionDefs())
@ -210,7 +210,7 @@ export async function find(ctx: UserCtx) {
ctx.body = await db.get(ctx.params.id)
}
export async function destroy(ctx: UserCtx<void, DocumentDestroyResponse>) {
export async function destroy(ctx: UserCtx<void, DeleteAutomationResponse>) {
const db = context.getAppDB()
const automationId = ctx.params.id
const oldAutomation = await db.get<Automation>(automationId)

View file

@ -1,9 +1,17 @@
import { EMPTY_LAYOUT } from "../../constants/layouts"
import { generateLayoutID, getScreenParams } from "../../db/utils"
import { events, context } from "@budibase/backend-core"
import { BBContext, Layout, UserCtx } from "@budibase/types"
import {
BBContext,
Layout,
SaveLayoutRequest,
SaveLayoutResponse,
UserCtx,
} from "@budibase/types"
export async function save(ctx: UserCtx<Layout, Layout>) {
export async function save(
ctx: UserCtx<SaveLayoutRequest, SaveLayoutResponse>
) {
const db = context.getAppDB()
let layout = ctx.request.body

View file

@ -0,0 +1,3 @@
import { DocumentDestroyResponse } from "@budibase/nano"
export interface DeleteAutomationResponse extends DocumentDestroyResponse {}

View file

@ -11,3 +11,5 @@ export * from "./global"
export * from "./pagination"
export * from "./searchFilter"
export * from "./cookies"
export * from "./automation"
export * from "./layout"

View file

@ -0,0 +1,5 @@
import { Layout } from "../../documents"
export interface SaveLayoutRequest extends Layout {}
export interface SaveLayoutResponse extends Layout {}