Skip to content

Commit ea4a078

Browse files
committed
♻️ refactor : Improve readability by using HTTP_STATUS.UNAUTHORIZED constant
- Replaced the hard-coded 401 status code with the HTTP_STATUS.UNAUTHORIZED constant. - This change improves the readability of the code and makes it easier to understand the meaning of the status code. Related issue: YJU-OKURA#128
1 parent 1b68c0d commit ea4a078

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/api/apiUtils.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import HTTP_STATUS from './httpStatus';
44
async function fetchWithInterceptors(url: string, options: RequestInit) {
55
let response = await fetch(url, options);
66

7-
if (response.status === 401) {
7+
if (response.status === HTTP_STATUS.UNAUTHORIZED) {
88
const refreshToken = localStorage.getItem('refresh_token');
99
const refreshResponse = await fetch(
1010
`${BASE_URLS.gin}/auth/google/refresh-token`,

0 commit comments

Comments
 (0)