updated validation for
Push notification delete User can not delete a push notification already sent Change-Id: Idb6e1fb851ee9ae1692f79f292a6b06b888566e9
This commit is contained in:
parent
feb0d479f1
commit
143a1b6b73
@ -244,7 +244,7 @@ final class SummitPushNotificationService
|
||||
(
|
||||
"not_found_errors.SummitPushNotificationService.deleteNotification.NotificationNotFound",
|
||||
[
|
||||
'summit_id' => $summit->getId(),
|
||||
'summit_id' => $summit->getId(),
|
||||
'notification_id' => $notification_id
|
||||
]
|
||||
)
|
||||
@ -252,6 +252,20 @@ final class SummitPushNotificationService
|
||||
);
|
||||
}
|
||||
|
||||
if($notification->isSent()){
|
||||
throw new ValidationException
|
||||
(
|
||||
trans
|
||||
(
|
||||
'validation_errors.SummitPushNotificationService.deleteNotification.NotificationAlreadySent',
|
||||
[
|
||||
'summit_id' => $summit->getId(),
|
||||
'notification_id' => $notification_id
|
||||
]
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
$summit->removeNotification($notification);
|
||||
});
|
||||
}
|
||||
|
@ -72,4 +72,5 @@ return [
|
||||
'SummitTrackService.copyTracks.SameSummit' => 'from summit is equal a to summit.',
|
||||
// SummitPushNotificationService
|
||||
'SummitPushNotificationService.addPushNotification.MemberNotActive' => 'member :member_id is not active',
|
||||
'SummitPushNotificationService.deleteNotification.NotificationAlreadySent' => 'notification :notification_id is already sent.',
|
||||
];
|
Loading…
x
Reference in New Issue
Block a user