Ejemplo n.º 1
0
        public async Task <IActionResult> AdminDelete(int?threadsId)
        {
            Thread t    = _service.GetById(threadsId);
            var    user = t.UserID;

            //delete from reports first
            await ResetReports(threadsId);

            //deletes the thread
            await _service.Delete(threadsId);

            //Gives a user a warining
            await _userService.GiveUserWarning(user);

            return(RedirectToAction("Reported", "Thread"));
        }