예제 #1
0
        public IActionResult Delete(int id)
        {
            UserService userService = new UserService();

            var user = userService.GetById(Int32.Parse(HttpContext.User.Claims.First().Value));

            if (user.isAdmin)
            {
                if (catalogService.Delete(id))
                {
                    return(Ok());
                }
            }
            else
            {
                if (catalogService.FakeDelete(id))
                {
                    return(Ok());
                }
            }

            return(BadRequest());
        }