Add paginated users/roles, user status, frontend permissions, profile pictures, identifier file storage
- Users page: paginated, searchable, sortable with inline roles (no N+1) - Roles page: paginated, searchable, sortable + /roles/all for dropdowns - User is_active field with migration, PATCH toggle, auth check (disabled=401) - Frontend permission checks: auth store loads permissions, sidebar/buttons conditional - Profile pictures via file storage for users and members, avatar component - Identifier images use file storage API instead of base64 - Fix TypeScript errors across admin UI - 64 API tests passing (10 new)
This commit is contained in:
@@ -1,15 +1,17 @@
|
||||
import { queryOptions } from '@tanstack/react-query'
|
||||
import { api } from '@/lib/api-client'
|
||||
import type { PaymentMethod } from '@/types/account'
|
||||
import type { PaginatedResponse, PaginationInput } from '@forte/shared/schemas'
|
||||
|
||||
export const paymentMethodKeys = {
|
||||
all: (accountId: string) => ['accounts', accountId, 'payment-methods'] as const,
|
||||
list: (accountId: string, params: PaginationInput) => [...paymentMethodKeys.all(accountId), params] as const,
|
||||
}
|
||||
|
||||
export function paymentMethodListOptions(accountId: string) {
|
||||
export function paymentMethodListOptions(accountId: string, params: PaginationInput) {
|
||||
return queryOptions({
|
||||
queryKey: paymentMethodKeys.all(accountId),
|
||||
queryFn: () => api.get<{ data: PaymentMethod[] }>(`/v1/accounts/${accountId}/payment-methods`),
|
||||
queryKey: paymentMethodKeys.list(accountId, params),
|
||||
queryFn: () => api.get<PaginatedResponse<PaymentMethod>>(`/v1/accounts/${accountId}/payment-methods`, params),
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user