This commit is contained in:
Benjamin Toby
2025-05-05 15:34:42 +01:00
parent cd4a2f7902
commit 181501296a
6 changed files with 10 additions and 7 deletions
+1
View File
@@ -1521,6 +1521,7 @@ export type DsqlCrudParam<
table: string;
data?: T;
targetId?: string | number;
targetField?: string;
query?: DsqlCrudQueryObject<T>;
sanitize?: (data?: T) => T;
debug?: boolean;
+3 -2
View File
@@ -13,6 +13,7 @@ export default async function dsqlCrud<
query,
sanitize,
debug,
targetField,
}: DsqlCrudParam<T>): Promise<
| (PostReturn & {
queryObject?: ReturnType<Awaited<typeof sqlGenerator>>;
@@ -56,7 +57,7 @@ export default async function dsqlCrud<
query: {
action: "update",
table,
identifierColumnName: "id",
identifierColumnName: targetField || "id",
identifierValue: String(finalId),
data: finalData,
},
@@ -68,7 +69,7 @@ export default async function dsqlCrud<
query: {
action: "delete",
table,
identifierColumnName: "id",
identifierColumnName: targetField || "id",
identifierValue: String(finalId),
},
forceLocal: true,