Updates
This commit is contained in:
@@ -9,11 +9,12 @@ export default async function dsqlCrud<
|
||||
action,
|
||||
data,
|
||||
table,
|
||||
targetId,
|
||||
targetValue,
|
||||
query,
|
||||
sanitize,
|
||||
debug,
|
||||
targetField,
|
||||
targetId,
|
||||
}: DsqlCrudParam<T>): Promise<
|
||||
| (PostReturn & {
|
||||
queryObject?: ReturnType<Awaited<typeof sqlGenerator>>;
|
||||
@@ -21,7 +22,6 @@ export default async function dsqlCrud<
|
||||
| null
|
||||
> {
|
||||
const finalData = sanitize ? sanitize(data) : data;
|
||||
const finalId = targetId;
|
||||
let queryObject: ReturnType<Awaited<typeof sqlGenerator>> | undefined;
|
||||
|
||||
switch (action) {
|
||||
@@ -58,7 +58,7 @@ export default async function dsqlCrud<
|
||||
action: "update",
|
||||
table,
|
||||
identifierColumnName: targetField || "id",
|
||||
identifierValue: String(finalId),
|
||||
identifierValue: String(targetValue || targetId),
|
||||
data: finalData,
|
||||
},
|
||||
forceLocal: true,
|
||||
@@ -70,7 +70,7 @@ export default async function dsqlCrud<
|
||||
action: "delete",
|
||||
table,
|
||||
identifierColumnName: targetField || "id",
|
||||
identifierValue: String(finalId),
|
||||
identifierValue: String(targetValue || targetId),
|
||||
},
|
||||
forceLocal: true,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user