Move domain items up to lib

- WIP on converting more complex queries
This commit is contained in:
2024-05-31 22:57:24 -04:00
parent f7f5dba795
commit 610ab67475
16 changed files with 189 additions and 167 deletions

View File

@@ -9,9 +9,9 @@ use BitBadger\Documents\DocumentException;
use BitBadger\Documents\Field;
use BitBadger\Documents\SQLite\Delete;
use FeedReaderCentral\Data;
use FeedReaderCentral\Domain\Table;
use FeedReaderCentral\Feed;
use FeedReaderCentral\Security;
use FeedReaderCentral\Table;
include '../../start.php';
@@ -57,12 +57,15 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST') {
}
if ($feedId == 'new') {
$title = 'Add RSS Feed';
$feed = ['id' => $_GET['id'], 'url' => ''];
$title = 'Add RSS Feed';
$feed = new Feed();
$feed->id = $_GET['id'];
} else {
$title = 'Edit RSS Feed';
if ($feedId == 'error') {
$feed = ['id' => $_POST['id'] ?? '', 'url' => $_POST['url'] ?? ''];
$feed = new Feed();
$feed->id = $_POST['id'] ?? '';
$feed->url = $_POST['url'] ?? '';
} elseif (!($feed = Feed::retrieveById((int)$feedId))) not_found();
}
@@ -70,10 +73,10 @@ page_head($title); ?>
<h1><?=$title?></h1>
<article>
<form method=POST action=/feed/ hx-post=/feed/>
<input type=hidden name=id value=<?=$feed['id']?>>
<input type=hidden name=id value=<?=$feed->id?>>
<label>
Feed URL
<input type=url name=url required autofocus value="<?=$feed['url']?>">
<input type=url name=url required autofocus value="<?=$feed->url?>">
</label>
<span class=break></span>
<button type=submit>Save</button>