@@ -5,18 +5,18 @@ import { API_URL } from '@/api/config'
55
66export const CustomerAPI = {
77 checkSelf : async ( headers : HeadersInit ) : Promise < boolean > => {
8- const response = await fetch ( `${ API_URL } /customer/check` , { method : 'GET' , headers : headers } )
9- if ( response . ok ) {
8+ const response = await fetch ( `${ API_URL } /customer/check/ ` , { method : 'GET' , headers : headers } )
9+ if ( response . ok ) {
1010 return await response . json ( ) as boolean
1111 }
1212 throw response
1313 } ,
1414 getMyself : async ( headers : HeadersInit ) : Promise < Customer | null > => {
15- if ( ! await CustomerAPI . checkSelf ( headers ) ) {
15+ if ( ! await CustomerAPI . checkSelf ( headers ) ) {
1616 return null
1717 }
1818 const response = await fetch ( `${ API_URL } /customer/` , { method : 'GET' , headers : headers } )
19- if ( response . ok ) {
19+ if ( response . ok ) {
2020 return CustomerHelpers . fromJson ( await response . json ( ) )
2121 }
2222 throw response
@@ -27,7 +27,7 @@ export const CustomerAPI = {
2727 headers : { ...headers , 'Content-Type' : 'application/json' } ,
2828 body : JSON . stringify ( CustomerHelpers . toJsonCreate ( customer ) ) ,
2929 } )
30- if ( response . ok ) {
30+ if ( response . ok ) {
3131 return CustomerHelpers . fromJson ( await response . json ( ) )
3232 }
3333 throw response
@@ -38,7 +38,7 @@ export const CustomerAPI = {
3838 headers : { ...headers , 'Content-Type' : 'application/json' } ,
3939 body : JSON . stringify ( CustomerHelpers . toJsonUpdate ( customer ) ) ,
4040 } )
41- if ( response . ok ) {
41+ if ( response . ok ) {
4242 return CustomerHelpers . fromJson ( await response . json ( ) )
4343 }
4444 throw response
0 commit comments