mirror of
https://github.com/ccmjga/zhilu-admin
synced 2026-04-08 06:27:36 +00:00
init
This commit is contained in:
18
frontend/src/composables/department/useDepartmentUpsert.ts
Normal file
18
frontend/src/composables/department/useDepartmentUpsert.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
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,
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user