mirror of
https://github.com/ccmjga/zhilu-admin
synced 2026-03-26 05:13:45 +08:00
19 lines
425 B
TypeScript
19 lines
425 B
TypeScript
import client from "../../api/client";
|
|
import type { DepartmentUpsertModel } from "../../types/department";
|
|
|
|
export const useDepartmentUpsert = () => {
|
|
const upsertDepartment = async (department: DepartmentUpsertModel) => {
|
|
await client.POST("/department", {
|
|
body: {
|
|
id: department.id,
|
|
name: department.name,
|
|
parentId: department.parentId ?? undefined,
|
|
},
|
|
});
|
|
};
|
|
|
|
return {
|
|
upsertDepartment,
|
|
};
|
|
};
|