File tree Expand file tree Collapse file tree 3 files changed +16
-10
lines changed
routes/session/$sessionId Expand file tree Collapse file tree 3 files changed +16
-10
lines changed Original file line number Diff line number Diff line change @@ -9,18 +9,16 @@ import {
99 PostRefreshResponseSchema ,
1010} from '@/features/auth/auth.dto' ;
1111
12- const AUTH_BASE_URL = '/api/auth' ;
13-
1412export const login = ( body : PostLoginRequestDTO ) =>
1513 axios
16- . post < PostLoginResponseDTO > ( `${ AUTH_BASE_URL } /login` , PostLoginRequestSchema . parse ( body ) )
14+ . post < PostLoginResponseDTO > ( `/api/auth /login` , PostLoginRequestSchema . parse ( body ) )
1715 . then ( ( res ) => PostLoginResponseSchema . parse ( res . data ) ) ;
1816
19- export const logout = ( ) => axios . post ( `${ AUTH_BASE_URL } /logout` ) ;
17+ export const logout = ( ) => axios . post ( `/api/auth /logout` ) ;
2018
2119export const refresh = ( ) =>
2220 axios
23- . post < PostRefreshResponseDTO > ( `${ AUTH_BASE_URL } /token` , undefined , {
21+ . post < PostRefreshResponseDTO > ( `/api/auth /token` , undefined , {
2422 withCredentials : true ,
2523 } )
2624 . then ( ( res ) => PostRefreshResponseSchema . parse ( res . data ) ) ;
Original file line number Diff line number Diff line change 11import { createFileRoute , redirect } from '@tanstack/react-router' ;
2+ import { useEffect } from 'react' ;
23
34import { refresh , useAuthStore } from '@/features/auth' ;
45import { getSessionToken , useSessionStore } from '@/features/session' ;
@@ -7,8 +8,18 @@ import { getQuestions } from '@/features/session/qna';
78
89import { QuestionList } from '@/components' ;
910
11+ function SessionComponent ( ) {
12+ const { sessionTitle } = useSessionStore ( ) ;
13+
14+ useEffect ( ( ) => {
15+ if ( sessionTitle ) document . title = `Ask-It - ${ sessionTitle } ` ;
16+ } , [ sessionTitle ] ) ;
17+
18+ return < QuestionList /> ;
19+ }
20+
1021export const Route = createFileRoute ( '/session/$sessionId/' ) ( {
11- component : QuestionList ,
22+ component : SessionComponent ,
1223 beforeLoad : async ( { params : { sessionId } } ) => {
1324 const {
1425 reset,
Original file line number Diff line number Diff line change @@ -128,7 +128,7 @@ test('회원 가입이 이미 중복된 닉네임이 있어서 실패하는 경
128128 await expect ( signUpButton ) . toBeDisabled ( ) ;
129129} ) ;
130130
131- test ( '로그인 / 로그아웃 플로우 전체 테스트' , async ( { page } ) => {
131+ test ( '로그인 플로우 전체 테스트' , async ( { page } ) => {
132132 await page . click ( 'text=로그인' ) ;
133133
134134 const loginButton = page . getByRole ( 'button' , { name : '로그인' } ) . nth ( 1 ) ;
@@ -151,7 +151,4 @@ test('로그인 / 로그아웃 플로우 전체 테스트', async ({ page }) =>
151151 expect ( ( await response ) . status ( ) ) . toBe ( 200 ) ;
152152
153153 await expect ( page . locator ( 'text=로그인 되었습니다.' ) ) . toBeVisible ( ) ;
154-
155- await page . click ( 'text=로그아웃' ) ;
156- await expect ( page . locator ( 'text=로그아웃 되었습니다.' ) ) . toBeVisible ( ) ;
157154} ) ;
You can’t perform that action at this time.
0 commit comments