Allow deleting and recreating the homepage
This commit is contained in:
@@ -174,9 +174,6 @@ final class Repository
|
||||
|
||||
public function deletePage(string $slug, int $version): bool
|
||||
{
|
||||
if ($slug === 'home') {
|
||||
throw new RuntimeException('首页是站点入口,不能删除。');
|
||||
}
|
||||
return Database::write(function (PDO $pdo) use ($slug, $version): bool {
|
||||
$page = $this->one('SELECT pages.layout_id, d.kind AS layout_kind FROM pages
|
||||
LEFT JOIN design_presets d ON pages.layout_id = d.id WHERE pages.slug = ?', [$slug]);
|
||||
|
||||
Reference in New Issue
Block a user