-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #41 from kkkkkSE/refactor/reflect-code-reviews
[style] 코드 스타일 변경 등 코드 리뷰 반영
- Loading branch information
Showing
46 changed files
with
236 additions
and
121 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export const VALID_ACCESS_TOKEN = 'VALIDACCESSTOKEN'; | ||
|
||
export const VALID_REFRESH_TOKEN = 'VALIDREFRESHTOKEN'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
const PLURAL_USER_TYPES : Record<string, string> = { | ||
company: 'companies', | ||
customer: 'customers', | ||
}; | ||
|
||
export const STATIC_API_PATHS = { | ||
OPEN_PROFILES: '/companies', | ||
AUTO_REPLIES_BY_CUSTOMER: '/auto-replies', | ||
AUTO_REPLIES_BY_COMPANY: '/company/auto-replies', | ||
REISSUE_TOKEN: '/token', | ||
LOGOUT: '/logout', | ||
UPLOAD_PROFILE_IMAGE: '/files?folder=profile', | ||
}; | ||
|
||
export const DYNAMIC_API_PATHS = { | ||
LOGIN: (type: string) => `/${type}/session`, | ||
CHANGE_PASSWORD: (type: string) => `/${PLURAL_USER_TYPES[type]}/me/password`, | ||
SIGN_UP: (type: string) => `/${PLURAL_USER_TYPES[type]}`, | ||
SELF_ACCOUNT: (type: string) => `/${PLURAL_USER_TYPES[type]}/me`, | ||
CHATROOMS: (type: string) => `/${type}/chatrooms`, | ||
CHATROOM: (type: string, id: number) => `/${type}/chatrooms/${id}`, | ||
OPEN_PROFILE: (id: number) => `/companies/${id}`, | ||
AUTO_REPLIES_FOR_CUSTOMER: (id: number) => `/auto-replies/${id}`, | ||
AUTO_REPLIES_FOR_COMPANY: (id: number) => `/company/auto-replies/${id}`, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
// eslint-disable-next-line import/prefer-default-export | ||
export const LOCAL_STORAGE_KEYS = { | ||
ACCESS_TOKEN: 'accessToken', | ||
USER_TYPE: 'userType', | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
// eslint-disable-next-line import/prefer-default-export | ||
export const QUERY_KEY = { | ||
CHAT_LIST: ['chatList'], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
export const STATIC_ROUTES = { | ||
HOME: '/', | ||
LOGIN: '/login', | ||
SIGN_UP: '/sign-up', | ||
CHATROOMS: '/chatrooms', | ||
MY_PROFILE: '/profile', | ||
EDIT_MY_PROFILE: '/profile/edit', | ||
AUTO_REPLIES: '/auto-replies', | ||
OPEN_PROFILES: '/open-profiles', | ||
ACCOUNT: '/account', | ||
DELETE_ACCOUNT: '/account/delete', | ||
CONFIRM_DELETE_ACCOUNT: '/account/delete/confirm', | ||
CHANGE_PASSWORD: '/account/change-password', | ||
}; | ||
|
||
export const DYNAMIC_ROUTES = { | ||
CHATROOM: (id: number) => `/chatrooms/${id}`, | ||
OPEN_PROFILE: (id: number) => `/open-profiles/${id}`, | ||
EDIT_AUTO_REPLIY: (id: number) => `/auto-replies/${id}`, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
import { useLocalStorage } from 'usehooks-ts'; | ||
|
||
import { LOCAL_STORAGE_KEYS } from '../constants/localStorage'; | ||
|
||
export default function useAccessToken() { | ||
const [accessToken, setAccessToken] = useLocalStorage('accessToken', ''); | ||
const [accessToken, setAccessToken] = useLocalStorage(LOCAL_STORAGE_KEYS.ACCESS_TOKEN, ''); | ||
|
||
return { accessToken, setAccessToken }; | ||
} |
Oops, something went wrong.