dev day #90 🥳

This commit is contained in:
Tomas Dvorak
2025-11-12 20:31:37 +01:00
parent 8762bde4bf
commit f3db65d350
103 changed files with 4053 additions and 2189 deletions
+17
View File
@@ -29,6 +29,15 @@ export type CommentBan = {
reason?: string;
until?: string | null;
created_at: string;
created_by_id?: number;
user?: {
id: number;
first_name?: string;
last_name?: string;
email?: string;
role?: string;
username?: string;
};
};
export async function adminListBans(): Promise<{ items: CommentBan[] }>{
@@ -49,6 +58,14 @@ export type UnbanRequest = {
created_at: string;
resolved_by_id?: number | null;
resolved_at?: string | null;
user?: {
id: number;
first_name?: string;
last_name?: string;
email?: string;
role?: string;
username?: string;
};
};
export async function adminListUnbanRequests(): Promise<{ items: UnbanRequest[] }>{
+10
View File
@@ -84,6 +84,16 @@ export interface NewsletterStatus {
interval_minutes: number;
next_approximate: string;
newsletter_enabled?: boolean;
// Scheduling detail (optional; provided by backend)
weekly_enabled?: boolean;
weekly_day?: 'sun' | 'mon' | 'tue' | 'wed' | 'thu' | 'fri' | 'sat';
weekly_hour?: number;
weekly_next_scheduled?: string;
matches_enabled?: boolean;
reminder_lead_hours?: number;
results_enabled?: boolean;
quiet_start?: number;
quiet_end?: number;
}
export const getNewsletterStatus = async (): Promise<NewsletterStatus> => {
+1
View File
@@ -6,6 +6,7 @@ export type CommentItem = {
id: number;
target_type: TargetType;
target_id: string;
target_label?: string;
parent_id?: number | null;
content: string;
status?: 'visible' | 'hidden';
+9 -2
View File
@@ -36,8 +36,15 @@ export async function createPublicShortLink(payload: { target_url: string; title
}
export async function listShortLinks(): Promise<{ items: any[] }> {
const res = await api.get<{ items: any[] }>('/admin/shortlinks');
return res.data;
// Prefer editor-accessible endpoint
try {
const res = await api.get<{ items: any[] }>('/shortlinks');
return res.data;
} catch (e) {
// Fallback to admin endpoint (admins only)
const res2 = await api.get<{ items: any[] }>('/admin/shortlinks');
return res2.data;
}
}
export async function getShortLinkStats(id: number | string): Promise<any> {