Files
helix-web-react/src/api/department/index.ts
T
2026-01-05 10:10:51 +08:00

14 lines
466 B
TypeScript

import webClient from "@/client/web-client"
import type { TreeNode } from "@/types/tree"
import type { Department } from "@/types/entity"
export async function fetchDepartmentTree(): Promise<TreeNode<Department>> {
const { data } = await webClient.get<TreeNode<Department>>("/departments/tree")
return data
}
export async function fetchDepartments(): Promise<Department[]> {
const { data } = await webClient.get<Department[]>("/departments")
return data
}