Some tweaks
This commit is contained in:
@@ -3,6 +3,7 @@ import { API_URL } from "./constants";
|
||||
import { ApiResponse } from "@/types/types";
|
||||
import IUser from "@/interfaces/IUser";
|
||||
import { cookies } from "next/headers";
|
||||
import { getApiUrl } from "@/utils/api";
|
||||
|
||||
const getMe = cache(
|
||||
async (sessionCookie?: string): Promise<ApiResponse<IUser> | null> => {
|
||||
@@ -12,7 +13,7 @@ const getMe = cache(
|
||||
if (!token) return null;
|
||||
sessionCookie = token;
|
||||
}
|
||||
const res = await fetch(`${API_URL}/users/me`, {
|
||||
const res = await fetch(`${getApiUrl()}/users/me`, {
|
||||
headers: { Authorization: `Bearer ${sessionCookie}` },
|
||||
});
|
||||
return await res.json();
|
||||
|
||||
Reference in New Issue
Block a user