完成admin-user-update

This commit is contained in:
2025-05-12 11:40:21 +08:00
parent 2dd088fdf3
commit 4f782e4cea
9 changed files with 155 additions and 57 deletions

View File

@@ -0,0 +1,3 @@
export function create() {
}

View File

@@ -1,2 +1,4 @@
export * from './list';
export * from './get';
export * from './get';
export * from './create';
export * from './update';

View File

@@ -0,0 +1,16 @@
import { User } from "@/lib/types/user";
import fetcher from "../../fetcher";
export type updateUser = {
username: string;
nickname: string;
email: string | null;
phone: string | null;
}
export async function update(userId: string, user: updateUser) {
return fetcher<User>(`/api/admin/user/${userId}`, {
body: JSON.stringify(user),
method: "PUT",
});
}