mirror of
https://github.com/Dvorinka/MyClubServer.git
synced 2026-06-04 02:32:57 +00:00
dev day #81
This commit is contained in:
@@ -88,7 +88,7 @@ export async function adminListTransactions(params?: { user_id?: number|string;
|
||||
return (res.data?.items || []) as AdminPointsTx[];
|
||||
}
|
||||
|
||||
export async function adminAdjustPoints(body: { user_id: number; delta: number; reason?: string; meta?: Record<string, any> }): Promise<{ ok: boolean }>{
|
||||
export async function adminAdjustPoints(body: { user_id: number; delta: number; reason?: string; meta?: Record<string, any>; current_password?: string }): Promise<{ ok: boolean }>{
|
||||
const res = await api.post('/admin/engagement/adjust', body);
|
||||
return res.data as { ok: boolean };
|
||||
}
|
||||
@@ -112,3 +112,17 @@ export async function adminGetUserProfile(user_id: number | string): Promise<Adm
|
||||
const res = await api.get(`/admin/engagement/profile/${user_id}`);
|
||||
return res.data as AdminUserProfile;
|
||||
}
|
||||
|
||||
export type AdminUserListItem = {
|
||||
id: number;
|
||||
email: string;
|
||||
name: string;
|
||||
role: string;
|
||||
isActive: boolean;
|
||||
createdAt: string;
|
||||
};
|
||||
|
||||
export async function adminListUsers(): Promise<AdminUserListItem[]> {
|
||||
const res = await api.get('/admin/users');
|
||||
return (res.data || []) as AdminUserListItem[];
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@ export interface Player {
|
||||
height?: number;
|
||||
weight?: number;
|
||||
image_url?: string;
|
||||
gender?: string;
|
||||
is_active: boolean;
|
||||
created_at?: string;
|
||||
email?: string;
|
||||
@@ -35,6 +36,7 @@ function normalize(p: any): Player {
|
||||
height: p.height ?? p.Height ?? undefined,
|
||||
weight: p.weight ?? p.Weight ?? undefined,
|
||||
image_url: p.image_url ?? p.ImageURL ?? undefined,
|
||||
gender: p.gender ?? p.Gender ?? undefined,
|
||||
is_active: Boolean(p.is_active ?? p.IsActive ?? true),
|
||||
created_at: p.created_at ?? p.CreatedAt ?? undefined,
|
||||
email: p.email ?? p.Email ?? undefined,
|
||||
|
||||
@@ -17,6 +17,7 @@ export type PublicSettings = {
|
||||
frontpage_layout?: string;
|
||||
frontpage_style?: string;
|
||||
hero_style?: 'grid' | 'scroller' | 'swiper' | 'swiper_full';
|
||||
premium?: boolean;
|
||||
club_id?: string;
|
||||
club_type?: 'football' | 'futsal';
|
||||
club_name?: string; // preferred display name
|
||||
|
||||
Reference in New Issue
Block a user