feat: eslint 적용 및 관련 코드 일괄 수정
This commit is contained in:
@@ -4,11 +4,11 @@ import type { appRouter } from '../../../game-api/src/router';
|
||||
export type GameRouter = typeof appRouter;
|
||||
|
||||
export const createGameTrpc = (port: number) => {
|
||||
return createTRPCProxyClient<GameRouter>({
|
||||
links: [
|
||||
httpBatchLink({
|
||||
url: `http://localhost:${port}/api/trpc`, // 실제 환경에서는 도메인/경로 조정 필요
|
||||
}),
|
||||
],
|
||||
});
|
||||
return createTRPCProxyClient<GameRouter>({
|
||||
links: [
|
||||
httpBatchLink({
|
||||
url: `http://localhost:${port}/api/trpc`, // 실제 환경에서는 도메인/경로 조정 필요
|
||||
}),
|
||||
],
|
||||
});
|
||||
};
|
||||
|
||||
@@ -2,20 +2,20 @@ import { createTRPCProxyClient, httpBatchLink } from '@trpc/client';
|
||||
import type { AppRouter } from '@sammo-ts/gateway-api';
|
||||
|
||||
const getSessionToken = (): string | null => {
|
||||
if (typeof window === 'undefined') {
|
||||
return null;
|
||||
}
|
||||
return window.localStorage.getItem('sammo-session-token');
|
||||
if (typeof window === 'undefined') {
|
||||
return null;
|
||||
}
|
||||
return window.localStorage.getItem('sammo-session-token');
|
||||
};
|
||||
|
||||
export const trpc = createTRPCProxyClient<AppRouter>({
|
||||
links: [
|
||||
httpBatchLink({
|
||||
url: '/api/trpc', // 실제 환경에 맞게 조정 필요
|
||||
headers() {
|
||||
const token = getSessionToken();
|
||||
return token ? { 'x-session-token': token } : {};
|
||||
},
|
||||
}),
|
||||
],
|
||||
links: [
|
||||
httpBatchLink({
|
||||
url: '/api/trpc', // 실제 환경에 맞게 조정 필요
|
||||
headers() {
|
||||
const token = getSessionToken();
|
||||
return token ? { 'x-session-token': token } : {};
|
||||
},
|
||||
}),
|
||||
],
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user