Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/components/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ const Home = () => {
isActive: isActive,
domains: domains.length === DOMAINS.length ? null : domains, // if null -> all domains
order: order,
page: currentPage,
page: currentPage - 1,
},
});
setQuery(q);
Expand All @@ -95,6 +95,7 @@ const Home = () => {
return p.filter((v) => v !== value);
});
}
setCurrentPage(1);
};
// domain check
const handleDomainCheck = (e: ChangeEvent<HTMLInputElement>) => {
Expand Down Expand Up @@ -123,6 +124,7 @@ const Home = () => {
setRecStatus('all');
setDmStatus(DOMAINS);
setOrderStatus(0);
setCurrentPage(1);
};

const renderPageNumbers = () => {
Expand Down Expand Up @@ -324,6 +326,7 @@ const Home = () => {
onClick={() => {
setIsActive(recStatus === 'recruiting');
setOpenDropdown(null);
setCurrentPage(1);
}}
>
적용
Expand Down Expand Up @@ -473,6 +476,7 @@ const Home = () => {
onClick={() => {
setDomain(dmStatus);
setOpenDropdown(null);
setCurrentPage(1);
}}
>
적용
Expand Down Expand Up @@ -531,6 +535,7 @@ const Home = () => {
onClick={() => {
setOrder(orderStatus);
setOpenDropdown(null);
setCurrentPage(1);
}}
>
적용
Expand Down
4 changes: 2 additions & 2 deletions src/contexts/PostContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,9 @@ export const PostProvider = ({ children }: PostProviderProps) => {
const url = `/api/post?${query}`;
const response = await apiClient.get<{
posts: ApiPost[]; // posts stored in array
paginator: { lastpage: number };
paginator: { lastPage: number };
}>(url);
setPaginator(response.data.paginator.lastpage);
setPaginator(response.data.paginator.lastPage);
const apiPosts = response.data.posts;
const formattedPosts: Post[] = apiPosts.map((p: ApiPost) => ({
id: p.id,
Expand Down