13 lines
1002 B
TypeScript
13 lines
1002 B
TypeScript
import { rpc } from '../rpcClient'
|
|
import type { Group, Consultant } from '../types'
|
|
|
|
export const listGroups = (): Promise<Group[]> => rpc('consultants', 'listGroups')
|
|
export const addGroup = (group: Omit<Group, 'id'>): Promise<number> => rpc('consultants', 'addGroup', group)
|
|
|
|
export const listConsultants = (): Promise<Consultant[]> => rpc('consultants', 'listConsultants')
|
|
export const getConsultant = (id: number): Promise<Consultant | undefined> => rpc('consultants', 'getConsultant', id)
|
|
export const getConsultantsByIds = (ids: number[]): Promise<Consultant[]> => rpc('consultants', 'getConsultantsByIds', ids)
|
|
export const addConsultant = (consultant: Omit<Consultant, 'id'>): Promise<number> => rpc('consultants', 'addConsultant', consultant)
|
|
export const updateConsultant = (id: number, patch: Partial<Consultant>): Promise<number> => rpc('consultants', 'updateConsultant', id, patch)
|
|
export const deleteConsultant = (id: number): Promise<void> => rpc('consultants', 'deleteConsultant', id)
|