Skip to content

Commit b7ff8cc

Browse files
committed
fix check endpoint
1 parent 9f88097 commit b7ff8cc

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

customer/api/services/customer.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,18 @@ import { API_URL } from '@/api/config'
55

66
export 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

Comments
 (0)