コード例 #1
0
        public ActionResult DeletePackage(string packageId)
        {
            try
            {
                _indexService.DeletePackage(packageId);
                _packageListCache.Clear();

                return(new JsonResult(new
                {
                    success = new
                    {
                        description = "Package deleted"
                    }
                }));
            }
            catch (PackageNotFoundException)
            {
                return(Responses.NotFoundError(this, $"Package "));
            }
            catch (Exception ex)
            {
                _log.LogError(ex, "An unexpected error occurred.");
                return(Responses.UnexpectedError());
            }
        }