fix: #14112, federation/rules and relays ACP pages not refreshing table properly on changes, basic form validation

This commit is contained in:
Julian Lam
2026-03-20 11:15:24 -04:00
parent 5ed7eb6461
commit f5e2a0f49a
6 changed files with 22 additions and 9 deletions

View File

@@ -110,8 +110,11 @@ Admin.activitypub.reorderRules = async (req, res) => {
helpers.formatApiResponse(200, res, await activitypub.rules.list());
};
Admin.activitypub.addRelay = async (req, res) => {
Admin.activitypub.addRelay = async (req, res, next) => {
const { url } = req.body;
if (!url) {
return next();
}
await activitypub.relays.add(url);
helpers.formatApiResponse(200, res, await activitypub.relays.list());

View File

@@ -6,6 +6,6 @@
<form role="form">
<div class="mb-3">
<label class="form-label" for="url">Relay URL</label>
<input type="text" id="url" name="url" title="Relay URL" class="form-control" placeholder="https://example.org/actor">
<input type="url" id="url" name="url" title="Relay URL" class="form-control" placeholder="https://example.org/actor" required>
</div>
</form>

View File

@@ -14,7 +14,7 @@
</div>
<div class="mb-3">
<label class="form-label" for="value">Value</label>
<input type="text" id="value" name="value" title="Value" class="form-control" placeholder="forum">
<input type="text" id="value" name="value" title="Value" class="form-control" placeholder="forum" required>
<p class="form-text" id="help-text"></p>
</div>
<div class="mb-3">