-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Refactor: #153 전체 유저 검색 & 팀 유저 검색 axios 로직 수정 * Refactor: #153 SearchUserInput 컴포넌트 디바운스, Abort 로직 추가 * Refactor: #153 callback type 분리 * Rename: #153 파일 typo 수정 * Feat: #153 Exhaustive Check 기능 추가
- Loading branch information
Showing
6 changed files
with
95 additions
and
48 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
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,22 @@ | ||
import { findUser } from '@services/userService'; | ||
import { findUserByTeam } from '@services/teamService'; | ||
import { findUserByProject } from '@services/projectService'; | ||
|
||
export type FetchCallback<T> = T extends (...arg: infer P) => void ? (...arg: P) => Promise<void> : never; | ||
|
||
export type AllSearchCallback = { | ||
type: 'ALL'; | ||
searchCallback: FetchCallback<typeof findUser>; | ||
}; | ||
|
||
export type TeamSearchCallback = { | ||
type: 'TEAM'; | ||
searchCallback: FetchCallback<typeof findUserByTeam>; | ||
}; | ||
|
||
export type ProjectSearchCallback = { | ||
type: 'PROJECT'; | ||
searchCallback: FetchCallback<typeof findUserByProject>; | ||
}; | ||
|
||
export type SearchCallback = AllSearchCallback | TeamSearchCallback | ProjectSearchCallback; |
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 default function exhaustiveCheck(param: never, errorMessage: string) { | ||
throw new Error(errorMessage); | ||
} |