Respond to PR feedback.
This commit is contained in:
parent
4ba7070ca1
commit
223a268483
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
import { DocumentDestroyResponse } from "@budibase/nano"
|
||||
|
||||
export interface DeleteAutomationResponse extends DocumentDestroyResponse {}
|
|
@ -11,3 +11,5 @@ export * from "./global"
|
|||
export * from "./pagination"
|
||||
export * from "./searchFilter"
|
||||
export * from "./cookies"
|
||||
export * from "./automation"
|
||||
export * from "./layout"
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
import { Layout } from "../../documents"
|
||||
|
||||
export interface SaveLayoutRequest extends Layout {}
|
||||
|
||||
export interface SaveLayoutResponse extends Layout {}
|
Loading…
Reference in New Issue