Only return request object in action execute if the action was executed in EDIT mode. (#3426)

This commit is contained in:
Trisha Anand 2021-03-08 16:04:17 +05:30 committed by GitHub
parent 9bf78a06c0
commit 79164fde44
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -14,7 +14,6 @@ import com.appsmith.external.models.DatasourceConfiguration;
import com.appsmith.external.models.Param;
import com.appsmith.external.models.Policy;
import com.appsmith.external.models.Provider;
import com.appsmith.external.models.QActionConfiguration;
import com.appsmith.external.plugins.PluginExecutor;
import com.appsmith.server.acl.AclPermission;
import com.appsmith.server.acl.PolicyGenerator;
@ -668,6 +667,13 @@ public class NewActionServiceImpl extends BaseService<NewActionRepository, NewAc
result.setBody(error.getMessage());
return Mono.just(result);
})
.map(result -> {
// In case the action was executed in view mode, do not return the request object
if (TRUE.equals(executeActionDTO.getViewMode())) {
result.setRequest(null);
}
return result;
})
.elapsed()
.map(tuple -> {
log.debug("{}: Action {} with id {} execution time : {} ms",