diff --git a/client/app/app/(feed)/page.jsx b/client/app/app/(feed)/page.jsx index 988f2b0..7cb11e9 100644 --- a/client/app/app/(feed)/page.jsx +++ b/client/app/app/(feed)/page.jsx @@ -1,7 +1,7 @@ 'use client'; import PostList from '@/components/app/Post/List'; -import { getFeed } from '@/lib/api/auth'; +import { getFeed } from '@/lib/api/me'; export default function Page() { const fetchPosts = async (offset) => { diff --git a/client/app/app/settings/account/page.jsx b/client/app/app/settings/account/page.jsx index 07f77dc..1b55399 100644 --- a/client/app/app/settings/account/page.jsx +++ b/client/app/app/settings/account/page.jsx @@ -26,7 +26,7 @@ import { Input } from '@/components/ui/input'; import { Button } from '@/components/ui/button'; import { useToast } from '@/components/ui/use-toast'; import { useAuthStore } from '@/stores/auth'; -import { updateMe } from '@/lib/api/auth'; +import { updateMe } from '@/lib/api/me'; export default function Page() { const user = useAuthStore((state) => state.user); diff --git a/client/app/app/settings/profile/page.jsx b/client/app/app/settings/profile/page.jsx index 76a68fa..53e76b9 100644 --- a/client/app/app/settings/profile/page.jsx +++ b/client/app/app/settings/profile/page.jsx @@ -20,7 +20,7 @@ import { Button } from '@/components/ui/button'; import { useToast } from '@/components/ui/use-toast'; import Avatar from '@/components/app/User/Avatar'; import { useAuthStore } from '@/stores/auth'; -import { updateMe } from '@/lib/api/auth'; +import { updateMe } from '@/lib/api/me'; const formSchema = z.object({ display_name: z diff --git a/client/components/app/Providers/Auth/index.js b/client/components/app/Providers/Auth/index.js index d073f7d..d3b8793 100644 --- a/client/components/app/Providers/Auth/index.js +++ b/client/components/app/Providers/Auth/index.js @@ -3,7 +3,7 @@ import { useEffect } from 'react'; import useLoadingStore from '@/stores/loading'; import useAuthStore from '@/stores/auth'; -import { me } from '@/lib/api/auth'; +import { me } from '@/lib/api/me'; export default function AuthProvider({ children }) { const setUser = useAuthStore((state) => state.setUser); diff --git a/client/lib/api/auth/index.js b/client/lib/api/auth/index.js index 678945a..33acd4e 100644 --- a/client/lib/api/auth/index.js +++ b/client/lib/api/auth/index.js @@ -25,31 +25,4 @@ export async function logout() { } catch (error) { return error.response; } -} - -export async function me() { - try { - const response = await api.get('/auth/me'); - return response; - } catch (error) { - return error.response; - } -} - -export async function updateMe(data) { - try { - const response = await api.patch('/auth/me', data); - return response; - } catch (error) { - return error.response; - } -} - -export async function getFeed() { - try { - const response = await api.get('/auth/me/feed'); - return response; - } catch (error) { - return error.response; - } } \ No newline at end of file diff --git a/client/lib/api/me/index.js b/client/lib/api/me/index.js new file mode 100644 index 0000000..b88b83e --- /dev/null +++ b/client/lib/api/me/index.js @@ -0,0 +1,28 @@ +import api from '@/lib/api'; + +export async function me() { + try { + const response = await api.get('/me'); + return response; + } catch (error) { + return error.response; + } +} + +export async function updateMe(data) { + try { + const response = await api.patch('/me', data); + return response; + } catch (error) { + return error.response; + } +} + +export async function getFeed() { + try { + const response = await api.get('/me/feed'); + return response; + } catch (error) { + return error.response; + } +} \ No newline at end of file