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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user