mirror of
https://github.com/ccmjga/zhilu-admin
synced 2026-03-25 12:53:43 +08:00
init
This commit is contained in:
20
frontend/src/composables/user/useUserUpsert.ts
Normal file
20
frontend/src/composables/user/useUserUpsert.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import { ref } from "vue";
|
||||
import client from "../../api/client";
|
||||
import type { UserUpsertSubmitModel } from "../../types/user";
|
||||
|
||||
export const useUserUpsert = () => {
|
||||
const upsertUser = async (user: UserUpsertSubmitModel) => {
|
||||
const { data } = await client.POST("/iam/user", {
|
||||
body: {
|
||||
id: user.id,
|
||||
username: user.username,
|
||||
password: user.password,
|
||||
enable: user.enable,
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
return {
|
||||
upsertUser,
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user