-
Notifications
You must be signed in to change notification settings - Fork 0
[fix] 대타 요청 비즈니스 로직 API 수정 #58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 8 commits
353c719
20431ab
6baaec9
c7fa4f4
3dd79da
e616be5
c02bf3d
1547120
5d95da3
8b1244c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
|
dohy-eon marked this conversation as resolved.
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,13 +2,18 @@ import { useMemo } from 'react' | |
| import { useInfiniteQuery } from '@tanstack/react-query' | ||
| import { fetchSubstituteRequests } from '@/features/manager/api/substitute' | ||
| import { adaptSubstituteRequestDto } from '@/features/manager/home/types/substitute' | ||
| import { resolveManagerApiStatuses } from '@/features/manager/substitute/lib/managerSubstituteListFilters' | ||
| import type { SubstituteListStatusFilter } from '@/features/user/substitute/lib/substituteListFilters' | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win 상태 필터 매핑을 feature 밖으로 올려주세요.
As per path instructions, “src/features/** … entities, shared 레이어만 import하는지”를 확인해야 합니다. 🤖 Prompt for AI AgentsSource: Path instructions |
||
| import { queryKeys } from '@/shared/lib/queryKeys' | ||
|
|
||
| export function useSubstituteRequestsViewModel( | ||
| workspaceId: number | null, | ||
| params?: { status?: string }, | ||
| params?: { statusFilter?: SubstituteListStatusFilter }, | ||
| pageSize = 10 | ||
| ) { | ||
| const statusFilter = params?.statusFilter ?? 'all' | ||
| const apiStatuses = resolveManagerApiStatuses(statusFilter) | ||
|
|
||
| const { | ||
| data, | ||
| fetchNextPage, | ||
|
|
@@ -19,14 +24,14 @@ export function useSubstituteRequestsViewModel( | |
| } = useInfiniteQuery({ | ||
| queryKey: queryKeys.substitute.list({ | ||
| workspaceId: workspaceId ?? undefined, | ||
| status: params?.status, | ||
| statusFilter, | ||
| pageSize, | ||
| }), | ||
| queryFn: ({ pageParam }) => | ||
| fetchSubstituteRequests({ | ||
| pageSize, | ||
| workspaceId: workspaceId ?? undefined, | ||
| status: params?.status, | ||
| status: apiStatuses.length > 0 ? apiStatuses : undefined, | ||
| cursor: pageParam as string | undefined, | ||
| }), | ||
| initialPageParam: undefined as string | undefined, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| import type { SubstituteListStatusFilter } from '@/features/user/substitute/lib/substituteListFilters' | ||
|
coderabbitai[bot] marked this conversation as resolved.
Outdated
|
||
| import { SubstituteApiStatus } from '@/shared/types/substituteStatus' | ||
|
|
||
| export type ManagerSubstituteListFilters = { | ||
| statusFilter: SubstituteListStatusFilter | ||
| } | ||
|
|
||
| /** 매니저 UI 필터 → API status (G5 기준) */ | ||
| export const MANAGER_FILTER_TO_API_STATUS: Record< | ||
| SubstituteListStatusFilter, | ||
| SubstituteApiStatus[] | ||
| > = { | ||
| all: [], | ||
| pending: [SubstituteApiStatus.ACCEPTED], | ||
| accepted: [SubstituteApiStatus.APPROVED], | ||
| cancelled: [SubstituteApiStatus.REJECTED_BY_APPROVER], | ||
| } | ||
|
|
||
| export function resolveManagerApiStatuses( | ||
| filter: SubstituteListStatusFilter | ||
| ): SubstituteApiStatus[] { | ||
| return MANAGER_FILTER_TO_API_STATUS[filter] | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🩺 Stability & Availability | 🟠 Major
🧩 Analysis chain
🏁 Script executed:
Repository: alter-app/alter-client
Length of output: 249
🏁 Script executed:
Repository: alter-app/alter-client
Length of output: 229
🏁 Script executed:
Repository: alter-app/alter-client
Length of output: 229
@tanstack/react-query와 Devtools 버전을 맞춰주세요.@tanstack/react-query-devtools@5.101.1은@tanstack/react-query@^5.101.1을 요구하므로, 현재^5.90.21과 peer 조건이 맞지 않습니다.react-query를^5.101.1로 올리거나 Devtools를 같은 릴리스 라인으로 내리세요.🤖 Prompt for AI Agents