@@ -8,68 +8,59 @@ const BASE_URL = env.BASE_URL + '/api';
8
8
const login = http . post ( `${ BASE_URL } ${ PATHS . LOGIN } ` , async ( { request } ) => {
9
9
const { accessToken, refreshToken } = ( await request . json ( ) ) as LoginVo ;
10
10
if ( accessToken === 'invalid_access' && refreshToken === 'invalid_refresh' ) {
11
- return BaseError ( 404 , '정상적인 토큰이 아닙니다 ' ) ;
11
+ return BaseError ( 404 , '잘못된 토큰입니다 ' ) ;
12
12
}
13
13
return BaseSuccess ( null ) ;
14
14
} ) ;
15
15
16
- const summary = http . get (
17
- `${ BASE_URL } ${ PATHS . SUMMARY } ` ,
18
- async ( { request : { headers } } ) => {
19
- if ( ! headers . get ( 'access_token' ) && ! headers . get ( 'refresh_token' ) ) {
20
- return BaseError ( 401 , '잘못된 토큰입니다' ) ;
21
- }
22
- return BaseSuccess ( {
23
- stats : {
24
- lastUpdatedDate : '2025-01-09T00:00:00Z102' ,
25
- totalLikes : 100 ,
26
- totalViews : 100 ,
27
- yesterdayLikes : 50 ,
28
- yesterdayViews : 50 ,
29
- } ,
30
- totalPostCount : 10 ,
31
- } ) ;
32
- } ,
33
- ) ;
16
+ const summary = http . get ( `${ BASE_URL } ${ PATHS . SUMMARY } ` , async ( { request : { headers } } ) => {
17
+ if ( ! headers . get ( 'access_token' ) && ! headers . get ( 'refresh_token' ) ) {
18
+ return BaseError ( 401 , '잘못된 토큰입니다' ) ;
19
+ }
20
+ return BaseSuccess ( {
21
+ stats : {
22
+ lastUpdatedDate : '2025-01-09T00:00:00Z102' ,
23
+ totalLikes : 100 ,
24
+ totalViews : 100 ,
25
+ yesterdayLikes : 50 ,
26
+ yesterdayViews : 50 ,
27
+ } ,
28
+ totalPostCount : 10 ,
29
+ } ) ;
30
+ } ) ;
34
31
35
- const me = http . get (
36
- `${ BASE_URL } ${ PATHS . ME } ` ,
37
- async ( { request : { headers } } ) => {
38
- if ( ! headers . get ( 'access_token' ) && ! headers . get ( 'refresh_token' ) ) {
39
- return BaseError ( 401 , '잘못된 토큰입니다' ) ;
40
- }
41
- return BaseSuccess ( {
42
-
43
- id : '111111-111111-111111-111111' ,
44
- profile : { thumbnail : undefined } ,
45
- username : 'test' ,
46
- } ) ;
47
- } ,
48
- ) ;
32
+ const me = http . get ( `${ BASE_URL } ${ PATHS . ME } ` , async ( { request : { headers } } ) => {
33
+ if ( ! headers . get ( 'access_token' ) && ! headers . get ( 'refresh_token' ) ) {
34
+ return BaseError ( 401 , '잘못된 토큰입니다' ) ;
35
+ }
36
+ return BaseSuccess ( {
37
+
38
+ id : '111111-111111-111111-111111' ,
39
+ profile : { thumbnail : undefined } ,
40
+ username : 'test' ,
41
+ } ) ;
42
+ } ) ;
49
43
50
- const posts = http . get (
51
- `${ BASE_URL } ${ PATHS . POSTS } ` ,
52
- async ( { request : { headers } } ) => {
53
- if ( ! headers . get ( 'access_token' ) && ! headers . get ( 'refresh_token' ) ) {
54
- return BaseError ( 401 , '잘못된 토큰입니다' ) ;
55
- }
56
- return BaseSuccess ( {
57
- nextCursor : '2025-01-09T00:00:00Z102,10' ,
58
- posts : [
59
- {
60
- createdAt : '2025-01-01T01:01:01Z103' ,
61
- id : '1' ,
62
- likes : 100 ,
63
- releasedAt : '2025-01-09T00:00:00Z102' ,
64
- title : 'test title' ,
65
- views : 100 ,
66
- yesterdayLikes : 100 ,
67
- yesterdayViews : 100 ,
68
- } ,
69
- ] ,
70
- } ) ;
71
- } ,
72
- ) ;
44
+ const posts = http . get ( `${ BASE_URL } ${ PATHS . POSTS } ` , async ( { request : { headers } } ) => {
45
+ if ( ! headers . get ( 'access_token' ) && ! headers . get ( 'refresh_token' ) ) {
46
+ return BaseError ( 401 , '잘못된 토큰입니다' ) ;
47
+ }
48
+ return BaseSuccess ( {
49
+ nextCursor : '2025-01-09T00:00:00Z102,10' ,
50
+ posts : [
51
+ {
52
+ createdAt : '2025-01-01T01:01:01Z103' ,
53
+ id : '1' ,
54
+ likes : 100 ,
55
+ releasedAt : '2025-01-09T00:00:00Z102' ,
56
+ title : 'test title' ,
57
+ views : 100 ,
58
+ yesterdayLikes : 100 ,
59
+ yesterdayViews : 100 ,
60
+ } ,
61
+ ] ,
62
+ } ) ;
63
+ } ) ;
73
64
74
65
export const handlers = [ login , summary , me , posts ] ;
75
66
0 commit comments