예제 #1
0
        public IActionResult DeleteEnergyExpenditure(Guid id)
        {
            var expenditure = activityRepository.GetEnergyExpenditure(id);

            if (expenditure == null)
            {
                return(NotFound());
            }
            if (expenditure.UserId != CurrentUserId)
            {
                return(Unauthorized());
            }

            activityRepository.DeleteEnergyExpenditure(expenditure);

            return(Ok());
        }