Skip to content
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

내 공고 내부 QA 반영 #56

Merged
merged 19 commits into from
Aug 30, 2024
Merged
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
172 changes: 28 additions & 144 deletions .pnp.cjs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"@radix-ui/react-dropdown-menu": "^2.1.1",
"@radix-ui/react-popover": "^1.1.1",
"@radix-ui/react-slot": "^1.1.0",
"@react-oauth/google": "^0.12.1",
"@tanstack/react-query": "^5.51.1",
"@tanstack/react-query-devtools": "^5.51.1",
"@tippyjs/react": "^4.2.6",
Expand Down Expand Up @@ -75,7 +76,6 @@
"lowlight": "^3.1.0",
"lucide-react": "^0.411.0",
"next": "14.2.4",
"next-auth": "beta",
"react": "^18",
"react-colorful": "^5.6.1",
"react-day-picker": "8.10.1",
Expand Down
6 changes: 5 additions & 1 deletion src/app/(sidebar)/(my-info)/apis/useDeleteCard.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import { http } from '@/apis/http';
import { useMutation, useQueryClient } from '@tanstack/react-query';
import { GET_INFO_CARD_LIST } from './useGetInfoCardList';
import { GET_RECRUIT_CARD_COUNT } from '../../my-recruit/[id]/api/useGetCardCount';
import { GET_RECRUIT_CARD_ID } from '../../my-recruit/[id]/api/useGetRecruitCards';
import { GET_CARD_TYPE_COUNT } from './useGetCardTypeCount';
import { GET_INFO_CARD_LIST } from './useGetInfoCardList';

const deleteCard = (cardId: number) => {
return http.delete({
Expand All @@ -17,6 +19,8 @@ export const useDeleteCard = () => {
onSuccess: () => {
queryClient.invalidateQueries({ queryKey: [GET_INFO_CARD_LIST] });
queryClient.invalidateQueries({ queryKey: [GET_CARD_TYPE_COUNT] });
queryClient.invalidateQueries({ queryKey: [GET_RECRUIT_CARD_ID] });
queryClient.invalidateQueries({ queryKey: [GET_RECRUIT_CARD_COUNT] });
},
});
};
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Button, Icon } from '@/system/components';
import { Icon } from '@/system/components';
import { Dialog, DialogClose, DialogContent, DialogTitle, DialogTrigger } from '@/system/components/Dialog/Dialog';
import { TagType, InfoType, INFO_TYPES } from '@/types/info';
import { PropsWithChildren, useState } from 'react';
Expand Down
14 changes: 7 additions & 7 deletions src/app/(sidebar)/my-recruit/[id]/api/useGetCardCount.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
import { http } from '@/apis/http';
import { RecruitType } from '@/types/recruit';
import { useSuspenseQuery } from '@tanstack/react-query';
import { useQuery } from '@tanstack/react-query';

type GetCardCountType = Record<RecruitType, number>;

export const GET_CARD_COUNT = 'get-card-count';
export const GET_RECRUIT_CARD_COUNT = 'get-card-count';

const getCardCount = (id: string) => {
const getRecruitCardCount = (id: string) => {
return http.get<GetCardCountType>({
url: `/recruits/${id}/cards/type-count`,
});
};

export function useGetCardCount(id: string) {
const result = useSuspenseQuery({
queryKey: ['get-card-count'],
export function useGetRecruitCardCount(id: string) {
const result = useQuery({
queryKey: [GET_RECRUIT_CARD_COUNT],
queryFn: async () => {
const res = await getCardCount(id);
const res = await getRecruitCardCount(id);
return res.data;
},
});
Expand Down
11 changes: 5 additions & 6 deletions src/app/(sidebar)/my-recruit/[id]/api/useGetRecruitById.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,13 @@ const getRecruitById = (id: string) => {
});
};

export function useGetRecruitById(id: string) {
const result = useSuspenseQuery({
queryKey: [GET_RECRUIT_BY_ID, id],
export const useGetRecruitById = (id: string) => {
return useSuspenseQuery({
queryKey: [GET_RECRUIT_BY_ID],
queryFn: async () => {
const res = await getRecruitById(id);

return res.data;
},
});

return result;
}
};
4 changes: 2 additions & 2 deletions src/app/(sidebar)/my-recruit/[id]/api/useGetRecruitCards.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { http } from '@/apis/http';
import { TagType } from '@/types';
import { useSuspenseQuery } from '@tanstack/react-query';
import { useQuery } from '@tanstack/react-query';

export type GetRecruitCardsType = {
id: number;
Expand All @@ -22,7 +22,7 @@ const getRecruitCards = ({ id, type, tagIds }: { id: string; type: string; tagId
};

export function useGetRecruitCards({ id, type, tagIds }: { id: string; type: string; tagIds?: number[] }) {
const result = useSuspenseQuery({
const result = useQuery({
queryKey: [GET_RECRUIT_CARD_ID, id, type, tagIds],
queryFn: async () => {
const res = await getRecruitCards({ id, type, tagIds });
Expand Down
4 changes: 2 additions & 2 deletions src/app/(sidebar)/my-recruit/[id]/api/useGetSeason.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { http } from '@/apis/http';
import { useSuspenseQuery } from '@tanstack/react-query';
import { useQuery } from '@tanstack/react-query';

export interface SeasonType {
name: string;
Expand All @@ -14,7 +14,7 @@ const getSeasons = () => {
};

export function useGetSeasons() {
const result = useSuspenseQuery({
const result = useQuery({
queryKey: [GET_SEASONS],
queryFn: async () => {
const res = await getSeasons();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { http } from '@/apis/http';
import { RecruitType } from '@/types/recruit';
import { useMutation, useQueryClient } from '@tanstack/react-query';
import { GET_CARD_COUNT } from './useGetCardCount';
import { GET_RECRUIT_CARD_COUNT } from './useGetCardCount';
import { GET_RECRUIT_CARD_ID } from './useGetRecruitCards';

interface PostCardResponse {
Expand Down Expand Up @@ -39,7 +39,7 @@ export const usePostCardInRecruit = () => {
},
onSuccess: () => {
queryClient.invalidateQueries({ queryKey: [GET_RECRUIT_CARD_ID] });
queryClient.invalidateQueries({ queryKey: [GET_CARD_COUNT] });
queryClient.invalidateQueries({ queryKey: [GET_RECRUIT_CARD_COUNT] });
},
});
};
Loading
Loading