Unable to deleted the root site

This commit is contained in:
Hisham Bin Ateya
2020-02-15 09:07:29 +03:00
parent ae24b0f3be
commit ece378c54f
2 changed files with 16 additions and 6 deletions

View File

@ -87,8 +87,15 @@ namespace Oqtane.Controllers
[Authorize(Roles = Constants.HostRole)]
public void Delete(int id)
{
Sites.DeleteSite(id);
logger.Log(LogLevel.Information, this, LogFunction.Delete, "Site Deleted {SiteId}", id);
if (Sites.GetSites().Count() > 1)
{
Sites.DeleteSite(id);
logger.Log(LogLevel.Information, this, LogFunction.Delete, "Site Deleted {SiteId}", id);
}
else
{
logger.Log(LogLevel.Warning, this, LogFunction.Delete, "Unable to delete the root site.");
}
}
}
}