fix: Split validateActionName (#29243)
This commit is contained in:
parent
33151d044d
commit
e018db8ec7
|
|
@ -286,7 +286,7 @@ public class NewActionServiceCEImpl extends BaseService<NewActionRepository, New
|
||||||
|
|
||||||
this.validateCreatorId(action);
|
this.validateCreatorId(action);
|
||||||
|
|
||||||
if (!entityValidationService.validateName(action.getName())) {
|
if (!isValidActionName(action)) {
|
||||||
action.setIsValid(false);
|
action.setIsValid(false);
|
||||||
invalids.add(AppsmithError.INVALID_ACTION_NAME.getMessage());
|
invalids.add(AppsmithError.INVALID_ACTION_NAME.getMessage());
|
||||||
}
|
}
|
||||||
|
|
@ -415,6 +415,10 @@ public class NewActionServiceCEImpl extends BaseService<NewActionRepository, New
|
||||||
.flatMap(this::setTransientFieldsInUnpublishedAction);
|
.flatMap(this::setTransientFieldsInUnpublishedAction);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected boolean isValidActionName(ActionDTO action) {
|
||||||
|
return entityValidationService.validateName(action.getName());
|
||||||
|
}
|
||||||
|
|
||||||
protected Mono<ActionDTO> validateCreatorId(ActionDTO action) {
|
protected Mono<ActionDTO> validateCreatorId(ActionDTO action) {
|
||||||
if (action.getPageId() == null || action.getPageId().isBlank()) {
|
if (action.getPageId() == null || action.getPageId().isBlank()) {
|
||||||
throw new AppsmithException(AppsmithError.INVALID_PARAMETER, FieldName.PAGE_ID);
|
throw new AppsmithException(AppsmithError.INVALID_PARAMETER, FieldName.PAGE_ID);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user