refactor: extract star/notification/badge helpers into database.py and add enrich_items content module

Introduce `update_target_stars`, `get_target_owner_uid`, and `VOTABLE_TARGETS`/`STAR_TARGETS` in database.py; replace inline badge insertion with `award_badge()` and inline notification creation with `create_notification()` across auth, comments, and follow routers; add `enrich_items()` in new content module to centralize post/gist list assembly and remove duplicated enrichment logic from feed and gists routers.
This commit is contained in:
2026-05-23 06:34:13 +00:00
parent ab1121a42a
commit d7d8314da0
34 changed files with 211 additions and 367 deletions
+3 -2
View File
@@ -1,3 +1,5 @@
import { Http } from "./Http.js";
class ServiceMonitor {
constructor() {
this.pollInterval = 5000;
@@ -29,8 +31,7 @@ class ServiceMonitor {
async pollServices() {
try {
const resp = await fetch("/admin/services/data");
const data = await resp.json();
const data = await Http.getJson("/admin/services/data");
const container = document.getElementById("services-list");
if (!container) return;
for (const svc of data.services) {