From f6e6243c81f47cd4d558e917a7319fa92f1d9ba9 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Wed, 26 Jul 2023 12:20:06 +0200 Subject: [PATCH] Type patch --- packages/server/src/api/controllers/row/index.ts | 9 ++++++--- packages/types/src/api/web/app/rows.ts | 6 ++++++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/packages/server/src/api/controllers/row/index.ts b/packages/server/src/api/controllers/row/index.ts index 7eeab0e9fa..92771411b5 100644 --- a/packages/server/src/api/controllers/row/index.ts +++ b/packages/server/src/api/controllers/row/index.ts @@ -9,10 +9,11 @@ import { DeleteRow, DeleteRows, Row, + PatchRowRequest, + PatchRowResponse, SearchResponse, SortOrder, SortType, - UserCtx, ViewV2, } from "@budibase/types" import * as utils from "./utils" @@ -30,7 +31,9 @@ function pickApi(tableId: any) { return internal } -export async function patch(ctx: UserCtx): Promise { +export async function patch( + ctx: UserCtx +): Promise { const appId = ctx.appId const tableId = utils.getTableId(ctx) const body = ctx.request.body @@ -39,7 +42,7 @@ export async function patch(ctx: UserCtx): Promise { return save(ctx) } try { - const { row, table } = await quotas.addQuery( + const { row, table } = await quotas.addQuery( () => pickApi(tableId).patch(ctx), { datasourceId: tableId, diff --git a/packages/types/src/api/web/app/rows.ts b/packages/types/src/api/web/app/rows.ts index d40d2ee15d..42622f091f 100644 --- a/packages/types/src/api/web/app/rows.ts +++ b/packages/types/src/api/web/app/rows.ts @@ -1,3 +1,9 @@ +import { Row } from "../../../documents" + +export interface PatchRowRequest extends Row {} + +export interface PatchRowResponse extends Row {} + export interface SearchResponse { rows: any[] }