feat: 优化项目目录结构
This commit is contained in:
2
apps/frontend/lib/api/user/index.ts
Normal file
2
apps/frontend/lib/api/user/index.ts
Normal file
@@ -0,0 +1,2 @@
|
||||
export * from './me';
|
||||
export * from './updatePassword';
|
||||
8
apps/frontend/lib/api/user/me.ts
Normal file
8
apps/frontend/lib/api/user/me.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
import { User } from "@/lib/types/user";
|
||||
import fetcher from "../fetcher";
|
||||
|
||||
export async function me() {
|
||||
return fetcher<User>('/api/user/me');
|
||||
}
|
||||
|
||||
export const USER_ME_CACHE_KEY = 'user-me-cache';
|
||||
10
apps/frontend/lib/api/user/updatePassword.ts
Normal file
10
apps/frontend/lib/api/user/updatePassword.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
import fetcher from "../fetcher";
|
||||
|
||||
export async function updatePassword(password: string) {
|
||||
return fetcher(`/api/user/password`, {
|
||||
method: 'PUT',
|
||||
body: JSON.stringify({
|
||||
password: password,
|
||||
}),
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user