diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/repositories/ce/BaseAppsmithRepositoryCEImpl.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/repositories/ce/BaseAppsmithRepositoryCEImpl.java index 0811b0e6e6f4..ef44c1b977b4 100644 --- a/app/server/appsmith-server/src/main/java/com/appsmith/server/repositories/ce/BaseAppsmithRepositoryCEImpl.java +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/repositories/ce/BaseAppsmithRepositoryCEImpl.java @@ -129,10 +129,9 @@ public Mono updateById(@NonNull String id, @NonNull T resource, AclPermission // Set policies to null in the update object resource.setPolicies(null); - return queryBuilder() - .byId(id) - .permission(permission) - .updateFirstAndFind(buildUpdateFromSparseResource(resource)); + final QueryAllParams q = queryBuilder().byId(id).permission(permission); + + return q.updateFirst(buildUpdateFromSparseResource(resource)).then(Mono.defer(q::one)); } public Mono updateByIdWithoutPermissionCheck(@NonNull String id, BridgeUpdate update) { @@ -356,19 +355,6 @@ public Mono updateExecute(@NonNull QueryAllParams params, @NonNull U })); } - public Mono updateExecuteAndFind(@NonNull QueryAllParams params, @NonNull UpdateDefinition update) { - if (QueryAllParams.Scope.ALL.equals(params.getScope())) { - // Not implemented yet, since not needed yet. - return Mono.error(new AppsmithException(AppsmithError.INVALID_PARAMETER, "scope")); - - } else if (QueryAllParams.Scope.FIRST.equals(params.getScope())) { - return updateExecute(params, update).then(Mono.defer(() -> queryOneExecute(params))); - - } else { - return Mono.error(new AppsmithException(AppsmithError.INVALID_PARAMETER, "scope")); - } - } - public BridgeUpdate buildUpdateFromSparseResource(T resource) { // In case the update is not used to update the policies, then set the policies to null to ensure that the // existing policies are not overwritten. diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/repositories/ce/params/QueryAllParams.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/repositories/ce/params/QueryAllParams.java index d033eee0ee9f..3a4583d2ed31 100644 --- a/app/server/appsmith-server/src/main/java/com/appsmith/server/repositories/ce/params/QueryAllParams.java +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/repositories/ce/params/QueryAllParams.java @@ -87,11 +87,6 @@ public Mono updateFirst(@NonNull UpdateDefinition update) { return repo.updateExecute(this, update); } - public Mono updateFirstAndFind(@NonNull UpdateDefinition update) { - scope = Scope.FIRST; - return repo.updateExecuteAndFind(this, update); - } - public QueryAllParams criteria(Criteria c) { if (c == null) { return this;