[common/components] feat: raw fetch 헤더에 토큰 주입
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { getConfig } from "@common/config";
|
||||
import { ENDPOINT } from "../config";
|
||||
import { getAuthHeaders } from "@/lib/auth-header";
|
||||
|
||||
export interface SiteInfo {
|
||||
siteId: string;
|
||||
@@ -61,9 +62,8 @@ export const getSiteInfo = async (siteId: string) => {
|
||||
`${BASE_URL}${ENDPOINT.CMS_SERVICE.SITES}/${siteId}`,
|
||||
{
|
||||
method: "GET",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
headers: getAuthHeaders(),
|
||||
credentials: "include",
|
||||
},
|
||||
);
|
||||
return response.json() as Promise<SiteInfo>;
|
||||
@@ -72,9 +72,8 @@ export const getSiteInfo = async (siteId: string) => {
|
||||
export const getSiteList = async (): Promise<SiteListResponse> => {
|
||||
const response = await fetch(`${BASE_URL}${ENDPOINT.CMS_SERVICE.SITE_LIST}`, {
|
||||
method: "GET",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
headers: getAuthHeaders(),
|
||||
credentials: "include",
|
||||
});
|
||||
return response.json();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user