mirror of
https://github.com/Dvorinka/MyClubServer.git
synced 2026-06-04 02:32:57 +00:00
dev day #90 🥳
This commit is contained in:
@@ -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[] }>{
|
||||
|
||||
@@ -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> => {
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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> {
|
||||
|
||||
Reference in New Issue
Block a user