Backend: .NET 10 Clean Architecture + LiteCqrs.Net + EF Core/PostgreSQL + Identity/JWT. Frontend: React 19 + Vite + TanStack Query/Router + Tailwind v4 with a retro CRT theme. Docker/compose deployment mirroring PnvPanel's conventions, scoped down to the current base feature set.
35 lines
1.0 KiB
TypeScript
35 lines
1.0 KiB
TypeScript
import { apiRequest } from '@/shared/api/client'
|
|
import type { PagedList, UserSummaryDto } from '@/shared/api/types'
|
|
|
|
export type ListUsersParams = {
|
|
page: number
|
|
pageSize: number
|
|
search?: string
|
|
roleId?: string
|
|
isBlocked?: boolean
|
|
}
|
|
|
|
export function listUsers(params: ListUsersParams) {
|
|
const query = new URLSearchParams({
|
|
page: String(params.page),
|
|
pageSize: String(params.pageSize),
|
|
})
|
|
if (params.search) query.set('search', params.search)
|
|
if (params.roleId) query.set('roleId', params.roleId)
|
|
if (params.isBlocked !== undefined) query.set('isBlocked', String(params.isBlocked))
|
|
|
|
return apiRequest<PagedList<UserSummaryDto>>(`/admin/users?${query.toString()}`)
|
|
}
|
|
|
|
export function blockUser(id: string) {
|
|
return apiRequest<void>(`/admin/users/${id}/block`, { method: 'POST' })
|
|
}
|
|
|
|
export function unblockUser(id: string) {
|
|
return apiRequest<void>(`/admin/users/${id}/unblock`, { method: 'POST' })
|
|
}
|
|
|
|
export function deleteUser(id: string) {
|
|
return apiRequest<void>(`/admin/users/${id}`, { method: 'DELETE' })
|
|
}
|