Type patch

This commit is contained in:
Adria Navarro 2023-07-26 12:20:06 +02:00
parent b69e18ab70
commit f6e6243c81
2 changed files with 12 additions and 3 deletions

View File

@ -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<any> {
export async function patch(
ctx: UserCtx<PatchRowRequest, PatchRowResponse>
): Promise<any> {
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<any> {
return save(ctx)
}
try {
const { row, table } = await quotas.addQuery<any>(
const { row, table } = await quotas.addQuery(
() => pickApi(tableId).patch(ctx),
{
datasourceId: tableId,

View File

@ -1,3 +1,9 @@
import { Row } from "../../../documents"
export interface PatchRowRequest extends Row {}
export interface PatchRowResponse extends Row {}
export interface SearchResponse {
rows: any[]
}