Add member identifiers UI, member detail page, kebab menus
- Member detail page at /members/:id with edit form and identity documents - Expandable identity documents on account members tab - Kebab menu on both members list and account members tab (Edit, View IDs, View Account, Delete) - Identifier form with image upload (base64), ID type select, dates - Wiki article for identity documents
This commit is contained in:
25
packages/admin/src/api/identifiers.ts
Normal file
25
packages/admin/src/api/identifiers.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
import { queryOptions } from '@tanstack/react-query'
|
||||
import { api } from '@/lib/api-client'
|
||||
import type { MemberIdentifier } from '@/types/account'
|
||||
|
||||
export const identifierKeys = {
|
||||
all: (memberId: string) => ['members', memberId, 'identifiers'] as const,
|
||||
}
|
||||
|
||||
export function identifierListOptions(memberId: string) {
|
||||
return queryOptions({
|
||||
queryKey: identifierKeys.all(memberId),
|
||||
queryFn: () => api.get<{ data: MemberIdentifier[] }>(`/v1/members/${memberId}/identifiers`),
|
||||
})
|
||||
}
|
||||
|
||||
export const identifierMutations = {
|
||||
create: (memberId: string, data: Record<string, unknown>) =>
|
||||
api.post<MemberIdentifier>(`/v1/members/${memberId}/identifiers`, data),
|
||||
|
||||
update: (id: string, data: Record<string, unknown>) =>
|
||||
api.patch<MemberIdentifier>(`/v1/identifiers/${id}`, data),
|
||||
|
||||
delete: (id: string) =>
|
||||
api.del<MemberIdentifier>(`/v1/identifiers/${id}`),
|
||||
}
|
||||
Reference in New Issue
Block a user