23 lines
532 B
TypeScript
23 lines
532 B
TypeScript
|
|
import { http } from './http'
|
||
|
|
|
||
|
|
export interface BlacklistItem {
|
||
|
|
id: number
|
||
|
|
userId: number | null
|
||
|
|
email: string | null
|
||
|
|
nickname: string | null
|
||
|
|
reason: string | null
|
||
|
|
createdAt: string
|
||
|
|
}
|
||
|
|
|
||
|
|
export interface BlacklistAdd {
|
||
|
|
userId?: number
|
||
|
|
email?: string
|
||
|
|
reason?: string
|
||
|
|
}
|
||
|
|
|
||
|
|
export const blacklistApi = {
|
||
|
|
list: () => http.get<BlacklistItem[]>('/api/admin/blacklist'),
|
||
|
|
add: (body: BlacklistAdd) => http.post<void>('/api/admin/blacklist', body),
|
||
|
|
remove: (id: number) => http.del<void>(`/api/admin/blacklist/${id}`),
|
||
|
|
}
|