Ejemplo n.º 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));
        }
Ejemplo n.º 2
0
        public JsonResult Delete(Guid id)
        {
            bool result = _userNotificationService.Delete(id, User.Id);

            return(Json(result));
        }