Example #1
0
        public async Task <IActionResult> OnPostEditAsync()
        {
            if (!await CheckModel(false))
            {
                if (await GetData(PostData.Metadata.Id))
                {
                    return(Page());
                }
                else
                {
                    return(NotFound());
                }
            }

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

            try
            {
                await client.UpdateMetadataAsync(PostData.Metadata.Id, PostData.Metadata);

                await client.UpdateDescriptionAsync(PostData.Metadata.Id, PostData.Description);

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