diff --git a/qqq-backend-core/src/main/java/com/kingsrook/qqq/backend/core/actions/tables/DeleteAction.java b/qqq-backend-core/src/main/java/com/kingsrook/qqq/backend/core/actions/tables/DeleteAction.java index 32e0320a..a1c0096a 100644 --- a/qqq-backend-core/src/main/java/com/kingsrook/qqq/backend/core/actions/tables/DeleteAction.java +++ b/qqq-backend-core/src/main/java/com/kingsrook/qqq/backend/core/actions/tables/DeleteAction.java @@ -85,7 +85,8 @@ public class DeleteAction String primaryKeyFieldName = table.getPrimaryKeyField(); QFieldMetaData primaryKeyField = table.getField(primaryKeyFieldName); - List primaryKeys = deleteInput.getPrimaryKeys(); + List primaryKeys = deleteInput.getPrimaryKeys(); + List originalPrimaryKeys = primaryKeys == null ? null : new ArrayList<>(primaryKeys); if(CollectionUtils.nullSafeHasContents(primaryKeys) && deleteInput.getQueryFilter() != null) { throw (new QException("A delete request may not contain both a list of primary keys and a query filter.")); @@ -173,6 +174,11 @@ public class DeleteAction //////////////////////////////////// DeleteOutput deleteOutput = deleteInterface.execute(deleteInput); + ///////////////////////////////////////////////////////////////////////////////////////////////////////////// + // reset the input's list of primary keys -- callers may use & expect that to be what they had passed in!! // + ///////////////////////////////////////////////////////////////////////////////////////////////////////////// + deleteInput.setPrimaryKeys(originalPrimaryKeys); + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // merge the backend's output with any validation errors we found (whose pkeys wouldn't have gotten into the backend delete) // ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////