16 lines
459 B
TypeScript
16 lines
459 B
TypeScript
import { APIPathsCrudParams, APIResponseObject } from "../../types";
|
|
import dsqlCrud from "../../utils/data-fetching/crud";
|
|
|
|
export default async function <
|
|
T extends { [k: string]: any } = { [k: string]: any }
|
|
>({ table, body }: APIPathsCrudParams<T>): Promise<APIResponseObject> {
|
|
const POST_RESULT = await dsqlCrud({
|
|
...body?.crudParams,
|
|
action: "insert",
|
|
table,
|
|
data: body?.data,
|
|
});
|
|
|
|
return POST_RESULT;
|
|
}
|