Files
zhilu-admin/frontend/src/composables/department/useDepartmentUpsert.ts
Chuck1sn 3cd59337e7 init
2025-05-14 10:16:48 +08:00

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,
};
};