Skip to content

Commit 16a42c4

Browse files
authored
πŸš‘ post κ΄€λ ¨ νƒ€μž… μ§€μ • (#572)
### πŸ“ μž‘μ—… λ‚΄μš© - λ¨Έμ§€ 이후 νƒ€μž… μ •μ˜μ— μ˜ν•œ ci 터짐을 μˆ˜μ •ν•˜μ˜€μŠ΅λ‹ˆλ‹€.
1 parent c61ced4 commit 16a42c4

File tree

4 files changed

+71
-5
lines changed

4 files changed

+71
-5
lines changed

β€Žsrc/entities/post.tsβ€Ž

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import type { AuthorBriefDTO } from '@/entities/author';
22
import type { Domain } from '@/entities/company';
3+
import type { Link } from '@/entities/link';
34

45
export type JobMajorCategory =
56
| 'DEVELOPMENT'
@@ -66,3 +67,68 @@ export type CreatePostRequest = {
6667
salary?: number;
6768
employmentEndDate?: string;
6869
};
70+
71+
type CompanyDTO = {
72+
id: string;
73+
companyName: string;
74+
companyEstablishedYear: number;
75+
domain: Domain;
76+
headcount: number;
77+
location: string;
78+
slogan: string;
79+
detail: string;
80+
profileImageKey: string;
81+
companyInfoPDFKey?: string;
82+
landingPageLink?: string;
83+
links?: Link[];
84+
tags?: { tag: string }[];
85+
vcName?: string;
86+
vcRecommendation?: string;
87+
};
88+
89+
type PositionDTO = {
90+
id: string;
91+
positionTitle: string;
92+
positionType: string;
93+
headCount: number;
94+
salary: number | null;
95+
detail: string;
96+
employmentEndDate: string | null;
97+
createdAt: string;
98+
updatedAt: string;
99+
};
100+
101+
export type PostDetailDTO = {
102+
id: string;
103+
author: AuthorBriefDTO;
104+
company: CompanyDTO;
105+
position: PositionDTO;
106+
isBookmarked: boolean;
107+
};
108+
109+
type PostBriefDTO = {
110+
id: string;
111+
author: AuthorBriefDTO;
112+
companyName: string;
113+
profileImageKey: string;
114+
location: string;
115+
employmentEndDate: string | null;
116+
positionTitle: string;
117+
domain: string;
118+
detailSummary: string;
119+
slogan: string;
120+
positionType: string;
121+
headCount: number;
122+
isBookmarked: boolean;
123+
createdAt: string;
124+
updatedAt: string;
125+
tags: { tag: string }[];
126+
coffeeChatCount: number;
127+
};
128+
129+
export type PostsResponse = {
130+
posts: PostBriefDTO[];
131+
paginator: {
132+
lastPage: number;
133+
};
134+
};

β€Žsrc/feature/post/ui/common/PostCard.tsxβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import { useMutation, useQueryClient } from '@tanstack/react-query';
22
import { toast } from 'sonner';
33

4-
import type { PostsResponse } from '@/api/apis/localServer/schemas';
54
import { Badge } from '@/components/ui/badge';
65
import { ICON_SRC } from '@/entities/asset';
76
import type { BriefPost, PostFilter } from '@/entities/post';
7+
import type { PostsResponse } from '@/entities/post';
88
import type { ServiceResponse } from '@/entities/response';
99
import { formatEmploymentState } from '@/feature/post/presentation/postFormatPresentation';
1010
import { useGuardContext } from '@/shared/context/hooks';

β€Žsrc/feature/post/ui/detail/PostDetailView.tsxβ€Ž

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ import { MarkdownPreview } from '@/components/ui/markdown-preview';
1515
import { SeperatorLine } from '@/components/ui/separator';
1616
import { ICON_SRC } from '@/entities/asset';
1717
import { createErrorMessage } from '@/entities/errors';
18+
import type { PostDetailDTO } from '@/entities/post';
1819
import type { ServiceResponse } from '@/entities/response';
1920
import {
2021
checkPostActive,
2122
formatEmploymentState,
2223
} from '@/feature/post/presentation/postFormatPresentation';
2324
import { SkeletonPostDetailView } from '@/feature/post/ui/detail/SkeletonPostDetailView';
24-
import type { PostDetailResponse } from '@/mocks/post/schemas';
2525
import { useGuardContext } from '@/shared/context/hooks';
2626
import { ServiceContext } from '@/shared/context/ServiceContext';
2727
import { TokenContext } from '@/shared/context/TokenContext';
@@ -454,7 +454,7 @@ const useAddBookmark = () => {
454454
queryKey: ['postService', 'getPostDetail', postId, token],
455455
});
456456
const previousPostDetailData = await queryClient.getQueryData<
457-
ServiceResponse<PostDetailResponse>
457+
ServiceResponse<PostDetailDTO>
458458
>(['postService', 'getPostDetail', postId, token]);
459459
queryClient.setQueryData(
460460
['postService', 'getPostDetail', postId, token],
@@ -519,7 +519,7 @@ const useDeleteBookmark = () => {
519519
queryKey: ['postService', 'getPostDetail', postId, token],
520520
});
521521
const previousPostDetailData = await queryClient.getQueryData<
522-
ServiceResponse<PostDetailResponse>
522+
ServiceResponse<PostDetailDTO>
523523
>(['postService', 'getPostDetail', postId, token]);
524524
queryClient.setQueryData(
525525
['postService', 'getPostDetail', postId, token],

β€Žsrc/feature/post/ui/landing/LandingPostView.tsxβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export const LandingPostView = ({
5252
toPost({ postId });
5353
}}
5454
setShowSignInModal={setShowSignInModal}
55-
postFilter={{ ...postFilter, page: currentPage }}
55+
postFilter={postFilter}
5656
/>
5757
))}
5858
</>

0 commit comments

Comments
Β (0)