diff --git a/apps/frontend/lib/api/client.ts b/apps/frontend/lib/api/client.ts index 4ab1ff5..70130f6 100644 --- a/apps/frontend/lib/api/client.ts +++ b/apps/frontend/lib/api/client.ts @@ -45,4 +45,5 @@ export async function clientFetch( -export * as AuthAPI from './endpoints/auth.client' \ No newline at end of file +export * as AuthAPI from './endpoints/auth.client' +export * as UserAPI from './endpoints/user.client' \ No newline at end of file diff --git a/apps/frontend/lib/api/endpoints/user.client.ts b/apps/frontend/lib/api/endpoints/user.client.ts new file mode 100644 index 0000000..84d9cd4 --- /dev/null +++ b/apps/frontend/lib/api/endpoints/user.client.ts @@ -0,0 +1,6 @@ +import { User } from "@/lib/types/user"; +import { clientFetch } from "../client"; + +export async function me() { + return clientFetch('/api/user/me'); +} \ No newline at end of file diff --git a/apps/frontend/lib/api/endpoints/user.server.ts b/apps/frontend/lib/api/endpoints/user.server.ts new file mode 100644 index 0000000..2c33c4a --- /dev/null +++ b/apps/frontend/lib/api/endpoints/user.server.ts @@ -0,0 +1,6 @@ +import { User } from "@/lib/types/user"; +import { serverFetch } from "../server"; + +export async function me() { + return serverFetch('/api/user/me'); +} \ No newline at end of file diff --git a/apps/frontend/lib/api/server.ts b/apps/frontend/lib/api/server.ts index 31536f8..12912c7 100644 --- a/apps/frontend/lib/api/server.ts +++ b/apps/frontend/lib/api/server.ts @@ -56,4 +56,5 @@ export async function serverFetch( export * as BlogAPI from './endpoints/blog.server'; -export * as ResourceAPI from './endpoints/resource.server'; \ No newline at end of file +export * as ResourceAPI from './endpoints/resource.server'; +export * as UserAPI from './endpoints/user.server'; \ No newline at end of file