-
Notifications
You must be signed in to change notification settings - Fork 3
Hotfix/95/fix type #102
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
Hotfix/95/fix type #102
Changes from all commits
19fb83d
90cf98b
826a942
ebc9f13
c502374
647379c
b0530fc
ad88aa6
5c55f46
167ab28
46d1b5d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,39 +1,20 @@ | ||
| import { CrewCardInform } from '@/src/types/crew-card'; | ||
| import { MainCrewList } from '@/src/types/crew-card'; | ||
| import { getCrewList } from '../_apis/crew/get-crew-list'; | ||
|
|
||
| // Crew data λ³ν λ‘μ§μ κ°μνν helper ν¨μ | ||
| const mapCrewData = (crew: CrewCardInform) => ({ | ||
| crewId: crew.crewId, | ||
| type: crew.type, | ||
| subType: crew.subType, | ||
| name: crew.name, | ||
| location: crew.location, | ||
| detailedLocation: crew.detailedLocation, | ||
| participantCount: crew.participantCount, | ||
| capacity: crew.capacity, | ||
| images: crew.images, | ||
| createdBy: crew.createdBy, | ||
| createdDate: crew.createdDate, | ||
| updatedDate: crew.updatedDate, | ||
| isConfirmed: crew.isConfirmed, | ||
| gatheringCount: crew.gatheringCount, | ||
| crewMember: crew.crewMember, | ||
| }); | ||
|
|
||
| export function useGetCrewQuery() { | ||
| interface QueryParams { | ||
| pageParam?: number; | ||
| } | ||
|
|
||
| interface Page { | ||
| hasNextPage: boolean; | ||
| hasNext: boolean; | ||
| } | ||
|
|
||
| return { | ||
| queryKey: ['crew'], | ||
| queryFn: ({ pageParam = 0 }: QueryParams) => getCrewList(pageParam, 3), | ||
| getNextPageParam: (lastPage: Page, allPages: Page[]) => | ||
| lastPage.hasNextPage ? allPages.length + 1 : undefined, | ||
| select: (data: CrewCardInform[]) => data.map(mapCrewData), | ||
| lastPage.hasNext ? allPages.length + 1 : undefined, | ||
| select: (data: MainCrewList[]) => data, // κ·Έλλ‘ λ°ν | ||
| }; | ||
| } |
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,10 +2,10 @@ | |
|
|
||
| import { useState } from 'react'; | ||
| import { useGetCrewQuery } from '@/src/_queries/crew-queries'; | ||
| import { useInfiniteScroll } from '@/src/hooks/useInfiniteScroll'; | ||
| import { useInfiniteScroll } from '@/src/hooks/use-infinite-scroll'; | ||
| import CrewCardList from '@/src/components/common/crew-list/crew-card-list'; | ||
| import Tabs from '@/src/components/common/tab'; | ||
| import { CrewCardInformResponse } from '@/src/types/crew-card'; | ||
| import { MyCrewListResponse } from '@/src/types/crew-card'; | ||
|
|
||
| export default function MyCrewPage() { | ||
| const myPageTabs = [ | ||
|
|
@@ -15,8 +15,9 @@ export default function MyCrewPage() { | |
| const [currentTab, setCurrentTab] = useState(myPageTabs[0].id); | ||
|
|
||
| // TODO: fetchCrewData ν¨μλ₯Ό μ¬μ©νμ¬ λ°μ΄ν°λ₯Ό λΆλ¬μ€κΈ° : νλΌλ―Έν° μμ νμ | ||
| const { data, ref, isFetchingNextPage } = | ||
| useInfiniteScroll<CrewCardInformResponse>(useGetCrewQuery()); | ||
| // TODO: 리μ€νΈμλ λ€λ₯Έ λ°μ΄ν°λ₯Ό μ¬μ©ν΄μΌν΄μ μ°μ μ£Όμμ²λ¦¬ νμ΅λλ€. | ||
| // const { data, ref, isFetchingNextPage } = | ||
| // useInfiniteScroll<MyCrewListResponse>(useGetCrewQuery()); | ||
|
|
||
| return ( | ||
| <div className="py-8 md:py-12.5"> | ||
|
|
@@ -31,12 +32,12 @@ export default function MyCrewPage() { | |
| /> | ||
| </div> | ||
| <div className="mt-8 px-3 md:px-8 lg:px-11.5"> | ||
| <CrewCardList | ||
| {/* <CrewCardList | ||
| inWhere="my-crew" | ||
| data={data} | ||
| ref={ref} | ||
| isFetchingNextPage={isFetchingNextPage} | ||
| /> | ||
| /> */} | ||
|
Comment on lines
+35
to
+40
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. μ£Όμ μ²λ¦¬λ μ½λμ ν₯ν κ³ν λͺ μ νμ
λ€μ μ¬νλ€μ νμΈν΄μ£ΌμΈμ:
|
||
| </div> | ||
| </div> | ||
| ); | ||
|
|
||
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.
π‘ Codebase verification
Let me analyze the results from the shell scripts to verify the concern about the hardcoded
isConfirmedvalue.The results show:
isConfirmedis defined as a required boolean prop inDetailCrewCardPropsinterfacemock.jsonandcrew-data.tsshows bothtrueandfalsevalues being usedtrueandfalsevaluescrew-card-list.tsx,isConfirmedis dynamically passed based on conditions[id]/page.tsx) hardcodes it tofalseI can now generate the final response:
crewDetailλ°μ΄ν°μμisConfirmedκ°μ μ¬μ©ν΄μΌ ν©λλ€νμ¬ νλμ½λ©λ
falseκ° λμcrewDetailμμ μ 곡λλ μ€μ isConfirmedκ°μ μ¬μ©ν΄μΌ ν©λλ€. μ½λλ² μ΄μ€ λΆμ κ²°κ³Ό:DetailCrewCardλ μ€μ νμΈ μνλ₯Ό νμνλ μ»΄ν¬λνΈμ λλ€isConfirmedκ°μ μ λ¬νκ³ μμ΅λλ€mock.json)λ μ΄ νλλ₯Ό ν¬ν¨νκ³ μμ΅λλ€μμ μ μ:
π Analysis chain
νλμ½λ©λ isConfirmed κ°μ κ²μ¦μ΄ νμν©λλ€.
isConfirmedκ°falseλ‘ νλμ½λ©λμ΄ μμ΅λλ€. μ΄λ μμ ν΄κ²°μ± μΌλ‘ 보μ΄λ©°, λ€μ μ¬νλ€μ νμΈν΄μ£ΌμκΈ° λ°λλλ€:π Scripts executed
The following scripts were executed for the analysis:
Script:
Length of output: 5904