Moderation entfernt, JSON-API unter /api
- Moderationsseite und Melde-Funktion (report) komplett ausgebaut; folgt als eigenständiges Projekt - alle API-Endpunkte unter /api, dort ausschließlich JSON: auch 404, 405, Rate-Limit (429) und Panics (500) - Fehler nur über HTTP-Status; stille DB-Fehler in stats, logout und Vote-Zählern liefern jetzt 500 statt Nullen - /auth/headerbar entfernt (Frontend nutzt /api/user/info) - Frontend auf /api und statusbasierte Auswertung umgestellt - notes/api.md neu als Referenz der aktuellen API Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TiXsPUqw7oeomZ8wZrQW5q
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
2714fdb1a5
commit
030a5bd943
+6
-4
@@ -41,11 +41,13 @@ document.getElementById("delete-form").addEventListener("submit", async (e) => {
|
||||
});
|
||||
|
||||
async function init() {
|
||||
const info = await api.get(`/u/${encodeURIComponent(username)}/info`);
|
||||
if (info.error) {
|
||||
document.getElementById("profile-name").textContent = "Nutzer nicht gefunden";
|
||||
const res = await api.get(`/u/${encodeURIComponent(username)}/info`);
|
||||
if (!res.ok) {
|
||||
document.getElementById("profile-name").textContent =
|
||||
errMsg(res.data, "Profil konnte nicht geladen werden.");
|
||||
return;
|
||||
}
|
||||
const info = res.data;
|
||||
|
||||
document.getElementById("profile-name").textContent = info.username;
|
||||
document.getElementById("profile-avatar").src = avatarUrl(info.avatar);
|
||||
@@ -54,7 +56,7 @@ async function init() {
|
||||
|
||||
// Eigene Seite? -> Einstellungen einblenden.
|
||||
const me = await api.get("/user/info");
|
||||
const isOwner = me.username === info.username;
|
||||
const isOwner = me.ok && me.data.username === info.username;
|
||||
document.getElementById("settings").hidden = !isOwner;
|
||||
|
||||
createFeed(
|
||||
|
||||
Reference in New Issue
Block a user