Updates
This commit is contained in:
+9
-1
@@ -89,7 +89,15 @@ function apiCrudHandler(params) {
|
||||
default:
|
||||
break;
|
||||
}
|
||||
yield ((_c = params.postResultsFn) === null || _c === void 0 ? void 0 : _c.call(params, Object.assign(Object.assign({}, crudParams), { res: result })));
|
||||
yield ((_c = params.postResultsFn) === null || _c === void 0 ? void 0 : _c.call(params, Object.assign(Object.assign(Object.assign({}, lodash_1.default.omit(crudParams, [
|
||||
"postResultsFnExtraParameters",
|
||||
"postResultsFn",
|
||||
"deleteMiddleware",
|
||||
"putMiddleware",
|
||||
"postMiddleware",
|
||||
"getMiddleware",
|
||||
"auth",
|
||||
])), { res: result }), (params.postResultsFnExtraParameters || {}))));
|
||||
if (result) {
|
||||
return result;
|
||||
}
|
||||
|
||||
Vendored
+19
-3
@@ -2259,6 +2259,9 @@ export type APIPathsParams<T extends {
|
||||
putMiddleware?: APIPathsParamsCrudMiddleware<T>;
|
||||
deleteMiddleware?: APIPathsParamsCrudMiddleware<T>;
|
||||
postResultsFn?: APIPathsPostResulstsFn<T>;
|
||||
postResultsFnExtraParameters?: {
|
||||
[k: string]: any;
|
||||
};
|
||||
/** Runs For `POST`, `PUT`, and `DELETE` */
|
||||
crudMiddleware?: APIPathsParamsCrudMiddleware<T>;
|
||||
method: "GET" | "POST" | "PUT" | "DELETE";
|
||||
@@ -2311,9 +2314,22 @@ export type APIPathsPostResulstsFn<T extends {
|
||||
[k: string]: any;
|
||||
} = {
|
||||
[k: string]: any;
|
||||
}> = (params: APIPathsCrudParams<T> & {
|
||||
res?: APIResponseObject;
|
||||
}) => Promise<void>;
|
||||
}, P extends {
|
||||
[k: string]: any;
|
||||
} = {
|
||||
[k: string]: any;
|
||||
}> = (params: APIPathsPostResulstsFnParams<T, P>) => Promise<void>;
|
||||
export type APIPathsPostResulstsFnParams<T extends {
|
||||
[k: string]: any;
|
||||
} = {
|
||||
[k: string]: any;
|
||||
}, P extends {
|
||||
[k: string]: any;
|
||||
} = {
|
||||
[k: string]: any;
|
||||
}> = Omit<APIPathsCrudParams<T>, "postResultsFnExtraParameters" | "postResultsFn" | "deleteMiddleware" | "putMiddleware" | "postMiddleware" | "getMiddleware" | "auth"> & {
|
||||
res?: APIResponseObject<T>;
|
||||
} & P;
|
||||
export type APIPathsParamsAllowedTable = {
|
||||
table: string;
|
||||
allowedFields?: (string | RegExp)[];
|
||||
|
||||
Reference in New Issue
Block a user