Updates
This commit is contained in:
@@ -18,6 +18,7 @@ type Param<T extends { [k: string]: any } = any, K extends string = string> = {
|
||||
identifierValue?: string | number;
|
||||
forceLocal?: boolean;
|
||||
whereClauseObject?: DsqlCrudParamWhereClause;
|
||||
targetIds?: (string | number)[];
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -35,6 +36,7 @@ export default async function deleteDbEntry<
|
||||
identifierValue,
|
||||
forceLocal,
|
||||
whereClauseObject,
|
||||
targetIds,
|
||||
}: Param<T, K>): Promise<APIResponseObject<PostInsertReturn>> {
|
||||
try {
|
||||
const isMaster = forceLocal
|
||||
@@ -52,7 +54,10 @@ export default async function deleteDbEntry<
|
||||
|
||||
let values: any[] = [];
|
||||
|
||||
if (whereClauseObject) {
|
||||
if (targetIds) {
|
||||
query += ` WHERE id IN (${targetIds.map((id) => "?").join(",")})`;
|
||||
values = targetIds;
|
||||
} else if (whereClauseObject) {
|
||||
query += ` ${whereClauseObject.clause}`;
|
||||
values.push(...(whereClauseObject.params || []));
|
||||
} else if (identifierColumnName && identifierValue) {
|
||||
|
||||
Reference in New Issue
Block a user