This commit is contained in:
2025-12-31 10:28:52 +01:00
parent 276a0db83b
commit f7a2d6e03a
7 changed files with 51 additions and 14 deletions
+12
View File
@@ -2877,6 +2877,7 @@ export type APIPathsParams<
postMiddleware?: APIPathsParamsCrudMiddleware<T>;
putMiddleware?: APIPathsParamsCrudMiddleware<T>;
deleteMiddleware?: APIPathsParamsCrudMiddleware<T>;
postResultsFn?: APIPathsPostResulstsFn<T>;
/** Runs For `POST`, `PUT`, and `DELETE` */
crudMiddleware?: APIPathsParamsCrudMiddleware<T>;
method: "GET" | "POST" | "PUT" | "DELETE";
@@ -2931,6 +2932,17 @@ export type APIPathsParamsCrudMiddleware<
targetId?: number | string;
}) => Promise<APIPathsBody<T> | undefined>;
export type APIPathsPostResulstsFn<
T extends { [k: string]: any } = { [k: string]: any },
K extends string = string
> = (params: {
body?: APIPathsBody<T>;
query?: DsqlCrudQueryObject<T>;
table: K;
targetId?: number | string;
res?: APIResponseObject;
}) => Promise<APIPathsBody<T> | undefined>;
export type APIPathsParamsAllowedTable = {
table: string;
allowedFields?: (string | RegExp)[];