Example #1
0
        public Maybe <OperationError> Delete(int id)
        {
            var getResult = _userNotificationService.GetUserNotification(id);

            if (getResult.Failed)
            {
                return(getResult.Error);
            }

            var notificationToDelete = getResult.Value;

            if (!IsActiveUser(notificationToDelete.NotificationRecipientId))
            {
                return(new OperationError(OperationFailure.Forbidden));
            }

            return(_userNotificationService.Delete(id));
        }
        public JsonResult Delete(Guid id)
        {
            bool result = _userNotificationService.Delete(id, User.Id);

            return(Json(result));
        }