完成admin-user-update
This commit is contained in:
3
tone-page-web/lib/api/admin/user/create.ts
Normal file
3
tone-page-web/lib/api/admin/user/create.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
export function create() {
|
||||
|
||||
}
|
||||
@@ -1,2 +1,4 @@
|
||||
export * from './list';
|
||||
export * from './get';
|
||||
export * from './get';
|
||||
export * from './create';
|
||||
export * from './update';
|
||||
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