fixed validation error message

This commit is contained in:
Sofia Papacharalampous 2024-05-10 17:56:02 +03:00
parent 8e899db021
commit f383ef520f
2 changed files with 4 additions and 2 deletions

View File

@ -384,7 +384,7 @@ public class DmpServiceImpl implements DmpService {
.groupIds(oldDmpEntity.getGroupId())
.isActive(IsActive.Active)
.count();
if (notFinalizedCount > 0) throw new MyValidationException("Already created draft for this template");
if (notFinalizedCount > 0) throw new MyValidationException(this.errors.getModelValidation().getCode(), "Already created draft for this template");
DmpEntity newDmp = new DmpEntity();
newDmp.setId(UUID.randomUUID());

View File

@ -75,6 +75,8 @@ export class NewVersionDmpDialogComponent extends BaseComponent {
}
onCallbackError(error: any) {
this.uiNotificationService.snackBarNotification(error.error.message ? error.error.message : this.language.instant('GENERAL.SNACK-BAR.UNSUCCESSFUL-UPDATE'), SnackBarNotificationLevel.Error);
this.uiNotificationService.snackBarNotification(
error.error.message ? error.error.message :
error.error.error ? error.error.error : this.language.instant('GENERAL.SNACK-BAR.UNSUCCESSFUL-DELETE'), SnackBarNotificationLevel.Error);
}
}