-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: 프로젝트 리스트 무한스크롤 적용 * chore: 미사용 코드 제거 * feat: 프로젝트 전체 갯수 부활
- Loading branch information
Showing
6 changed files
with
83 additions
and
44 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,42 @@ | ||
import { QS } from '@toss/utils'; | ||
import { z } from 'zod'; | ||
|
||
import { createEndpoint } from '@/api/typedAxios'; | ||
|
||
export interface ProjectsRequestParams { | ||
limit?: number; | ||
cursor?: number; | ||
name?: string; | ||
} | ||
|
||
const LinkSchema = z.object({ | ||
linkId: z.number(), | ||
linkTitle: z.string(), | ||
linkUrl: z.string(), | ||
}); | ||
|
||
const ProjectSchema = z.object({ | ||
id: z.number(), | ||
name: z.string(), | ||
generation: z.number(), | ||
category: z.string(), | ||
serviceType: z.array(z.string()), | ||
summary: z.string(), | ||
detail: z.string(), | ||
logoImage: z.string(), | ||
thumbnailImage: z.string(), | ||
links: z.array(LinkSchema), | ||
}); | ||
|
||
export const getProjects = (params: ProjectsRequestParams) => | ||
createEndpoint({ | ||
request: { | ||
method: 'GET', | ||
url: 'api/v1/projects', | ||
data: QS.create({ params }), | ||
}, | ||
serverResponseScheme: z.object({ | ||
projectList: z.array(ProjectSchema), | ||
hasNext: z.boolean(), | ||
}), | ||
}); |
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
24 changes: 18 additions & 6 deletions
24
src/components/projects/upload/hooks/useGetProjectListQuery.ts
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