From 38718968b003079fa5cbfc89b0d8858c95a75971 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Wed, 10 Jul 2024 13:24:00 +0200 Subject: [PATCH] Basic implementation --- .../server/src/api/controllers/rowAction/crud.ts | 16 ++++++++++++++-- packages/types/src/api/web/app/index.ts | 1 + packages/types/src/api/web/app/rowAction.ts | 3 +++ 3 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 packages/types/src/api/web/app/rowAction.ts diff --git a/packages/server/src/api/controllers/rowAction/crud.ts b/packages/server/src/api/controllers/rowAction/crud.ts index 3bea2de73c..79a86233a8 100644 --- a/packages/server/src/api/controllers/rowAction/crud.ts +++ b/packages/server/src/api/controllers/rowAction/crud.ts @@ -1,9 +1,21 @@ +import { CreateRowActionRequest, Ctx, RowAction } from "@budibase/types" +import sdk from "../../../sdk" + export function find() { throw new Error("Function not implemented.") } -export function create() { - throw new Error("Function not implemented.") +export async function create(ctx: Ctx) { + const { tableId } = ctx.params + + const table = await sdk.tables.getTable(tableId) + if (!table) { + ctx.throw(404) + } + + // TODO + + ctx.status = 201 } export function update() { diff --git a/packages/types/src/api/web/app/index.ts b/packages/types/src/api/web/app/index.ts index cb1cea2b08..55e1428fb9 100644 --- a/packages/types/src/api/web/app/index.ts +++ b/packages/types/src/api/web/app/index.ts @@ -7,3 +7,4 @@ export * from "./table" export * from "./permission" export * from "./attachment" export * from "./user" +export * from "./rowAction" diff --git a/packages/types/src/api/web/app/rowAction.ts b/packages/types/src/api/web/app/rowAction.ts new file mode 100644 index 0000000000..9a7f2a85b1 --- /dev/null +++ b/packages/types/src/api/web/app/rowAction.ts @@ -0,0 +1,3 @@ +export interface CreateRowActionRequest {} + +export interface RowAction {}