Esempio n. 1
0
        public async Task <IActionResult> OnPostDeleteTestAsync()
        {
            if ((await GetModifyAuthorization()) == false)
            {
                return(Forbid());
            }
            if (!ModelState.IsValid)
            {
                return(BadRequest());
            }

            HttpClient     httpclient = clientFactory.CreateClient();
            ProblemsClient client     = new ProblemsClient(httpclient);

            try
            {
                await client.DeleteTestAsync(PostData.ProblemId, PostData.TestCaseId);

                return(RedirectToPage(new { id = PostData.ProblemId }));
            }
            catch
            {
                return(NotFound());
            }
        }