完成admin-user-update
This commit is contained in:
16
tone-page-web/lib/api/admin/user/update.ts
Normal file
16
tone-page-web/lib/api/admin/user/update.ts
Normal 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",
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user