-
Notifications
You must be signed in to change notification settings - Fork 5
[FEAT] 목록 조회 API 구조 #112
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
Merged
Merged
[FEAT] 목록 조회 API 구조 #112
Changes from all commits
Commits
Show all changes
54 commits
Select commit
Hold shift + click to select a range
7564330
#80 [MOD] red색상명 변경
sunhwaaRj 40a5660
#80 [MOD] 진행중 enum 변경
sunhwaaRj e2daa08
Merge branch 'develop' of https://github.com/vecosystem/VECO_Frontend…
sunhwaaRj 8d11f03
#80 [FEAT] 알림목록 조회 구조 작성
sunhwaaRj 17660d8
#80 [MOD] 변경된 모달 적용
sunhwaaRj f412196
#80 [MOD] 각 유형별 추가 버튼 navigator 연결
sunhwaaRj fb9fb77
#80 [MOD] 진행중 enum 변경
sunhwaaRj 748f0f5
Merge branch 'develop' of https://github.com/vecosystem/VECO_Frontend…
sunhwaaRj 34c7668
#80 [MOD] 상태 변수명 변경
sunhwaaRj 7f73d11
#80 [FEAT] 공통 쿼리 파라미터 타입
sunhwaaRj 0fb9e68
#80 [FEAT] 목표 리스트 api
sunhwaaRj 91cde34
#80 [FEAT] 이슈 리스트 api
sunhwaaRj de38cff
#80 [FEAT] 삭제 요소 id 넘기기
sunhwaaRj 5fff6c2
#80 [FEAT] 알림 종류 타입 추가
sunhwaaRj 2599868
#80 [FEAT] 알림 리스트 api
sunhwaaRj 7380b07
Merge branch 'develop' of https://github.com/vecosystem/VECO_Frontend…
sunhwaaRj afcc9ed
#80 [FEAT] 쿼리키 상수 추가
sunhwaaRj d039dab
#80 [FEAT] 목표 훅 함수
sunhwaaRj 43e5ce0
#80 [FEAT] 이슈 훅 함수
sunhwaaRj a33a19b
#80 [FEAT] 알림 훅 함수
sunhwaaRj 79d8229
#80 [FIX] 날짜 형식 string 추가
sunhwaaRj 1c35d68
#80 [FEAT] 알림 체크 위한 요소 추가
sunhwaaRj b9d64af
#80 [FEAT] 읽은 알림 배경색 추가
sunhwaaRj e9baf54
#80 [FIX] 알림 구조 수정
sunhwaaRj 8dc21cf
#80 [FEAT] 알림 api 구조에 맞도록 수정
sunhwaaRj 5d19b76
#80 [FEAT] 목표리스트 api 연결
sunhwaaRj 1eb90ed
#80 [FEAT] 외부 리스트 api
sunhwaaRj c737fe1
#80 [FEAT] 이슈 리스트 api 연동
sunhwaaRj 8d7ccfb
#80 [FEAT] 이슈 삭제 api 연동
sunhwaaRj 7befdfc
#80 [FEAT] 목표 삭제 api 연동
sunhwaaRj 39308df
#80 [FEAT] 알림 삭제 api
sunhwaaRj 9596a93
#80 [FEAT] 외부 삭제 api
sunhwaaRj 6e7ff7c
Merge branch 'develop' of https://github.com/vecosystem/VECO_Frontend…
sunhwaaRj 8ce087e
#80 [FEAT] 알림 읽음 처리 api
sunhwaaRj b4bf713
#80 [MOD] 리스트 요소 클릭이벤트 추가
sunhwaaRj 93a7975
#80 [MOD] 외부 클릭이벤트 props 추가
sunhwaaRj c6d9129
#80 [MOD] 알림 읽음처리 및 담당자 정보 추가
sunhwaaRj 38e2dab
#80 [MOD] 외부 리스트 api 연동
sunhwaaRj 75fb755
#80 [FEAT] 외부 삭제 api 연동
sunhwaaRj 0b40c2a
#80 [FIX] api 주소 변경
sunhwaaRj 9e2cd52
#80 [FEAT] 상세페이지 이동 onclick 이벤트
sunhwaaRj d6cdd16
Merge branch 'develop' of https://github.com/vecosystem/VECO_Frontend…
sunhwaaRj d67f1ce
#80 [FIX] 머지 충돌 수정
sunhwaaRj 9bcf905
#80 [MOVE] 알림 api 파일이동
sunhwaaRj 27f6bbb
#80 [MOVE] 외부 api 파일이동
sunhwaaRj 05c3e8c
#80 [MOVE] 목표 api 파일이동
sunhwaaRj 4f4ef1d
#80 [MOVE] 이슈 api 파일이동
sunhwaaRj a6e493f
#80 [MOD] 워크스페이스 페이지 삭제 모달 수정
sunhwaaRj 87e758b
#80 [FEAT] 워크스페이스 상세페이지 이동 onclick 이벤트
sunhwaaRj 91fdd78
#80 [ADD] 알림 구조 주석추가
sunhwaaRj 3fc7059
#80 [MOD] 알림 구조 더미데이터 수정
sunhwaaRj 8b3a92d
#112 [FIX] 깃허브 api undefined 오류 해결
gaeulzzang b20bb98
#112 [FIX] 워크스페이스 팀 생성 undefined 오류 해결
gaeulzzang 36cd616
#112 [FIX] 워크스페이스 팀 생성 undefined 오류 해결
gaeulzzang File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,31 @@ | ||
| import { useMutation } from '@tanstack/react-query'; | ||
| import { queryKey } from '../../constants/queryKey'; | ||
| import queryClient from '../../utils/queryClient'; | ||
| import type { RequestAlarmListDto } from '../../types/alarm'; | ||
| import type { CommonResponse } from '../../types/common'; | ||
| import { axiosInstance } from '../axios'; | ||
|
|
||
| // notification/NotiHome.tsx | ||
| const deleteAlarmItem = async (alarmIds: RequestAlarmListDto): Promise<CommonResponse> => { | ||
| try { | ||
| const { data } = await axiosInstance.delete(`api/alarms`, { | ||
| data: alarmIds, | ||
| }); | ||
| return data; | ||
| } catch (error) { | ||
| console.error('Error deleting alarm item:', error); | ||
| throw error; | ||
| } | ||
| }; | ||
|
|
||
| export const useDeleteAlarms = () => { | ||
| return useMutation({ | ||
| mutationFn: deleteAlarmItem, | ||
| onSuccess(data, variables) { | ||
| console.log('Alarms deleted successfully:', data); | ||
| queryClient.invalidateQueries({ | ||
| queryKey: [queryKey.NOTI_LIST, variables.alarmIds], | ||
| }); | ||
| }, | ||
| }); | ||
| }; |
This file contains hidden or 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,30 @@ | ||
| import { useQuery } from '@tanstack/react-query'; | ||
| import type { PaginationDto } from '../../types/common'; | ||
| import type { AlarmType } from '../../types/listItem'; | ||
| import { queryKey } from '../../constants/queryKey'; | ||
| import type { ResponseAlarmDto } from '../../types/alarm'; | ||
| import { axiosInstance } from '../axios'; | ||
|
|
||
| // notification/NotiHome.tsx | ||
| const getAlarmList = async ( | ||
| alarmtype: AlarmType, | ||
| paginationDto: PaginationDto | ||
| ): Promise<ResponseAlarmDto> => { | ||
| try { | ||
| const { query } = paginationDto; | ||
| const { data } = await axiosInstance.get(`api/alarms/${alarmtype}`, { | ||
| params: { query }, | ||
| }); | ||
| return data; | ||
| } catch (error) { | ||
| console.error('Error fetching alarm list:', error); | ||
| throw error; | ||
| } | ||
| }; | ||
|
|
||
| export const useGetAlarmList = (alarmtype: AlarmType, params: PaginationDto) => { | ||
| return useQuery({ | ||
| queryKey: [queryKey.NOTI_LIST, alarmtype, params], | ||
| queryFn: () => getAlarmList(alarmtype, params), | ||
| }); | ||
| }; |
This file contains hidden or 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,29 @@ | ||
| import { useMutation } from '@tanstack/react-query'; | ||
| import queryClient from '../../utils/queryClient'; | ||
| import { queryKey } from '../../constants/queryKey'; | ||
| import type { RequestAlarmListDto } from '../../types/alarm'; | ||
| import type { CommonResponse } from '../../types/common'; | ||
| import { axiosInstance } from '../axios'; | ||
|
|
||
| // notification/NotiHome.tsx | ||
| const patchAlarmItem = async ({ alarmId }: RequestAlarmListDto): Promise<CommonResponse> => { | ||
| try { | ||
| const { data } = await axiosInstance.patch(`api/alarms/${alarmId}`); | ||
| return data; | ||
| } catch (error) { | ||
| console.error('Error patching alarm item:', error); | ||
| throw error; | ||
| } | ||
| }; | ||
|
|
||
| export const usePatchAlarms = () => { | ||
| return useMutation({ | ||
| mutationFn: patchAlarmItem, | ||
| onSuccess(data, variables) { | ||
| console.log('Alarm patched successfully:', data); | ||
| queryClient.invalidateQueries({ | ||
| queryKey: [queryKey.NOTI_LIST, variables.alarmId], | ||
| }); | ||
| }, | ||
| }); | ||
| }; |
This file contains hidden or 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,35 @@ | ||
| import { useMutation } from '@tanstack/react-query'; | ||
| import queryClient from '../../utils/queryClient'; | ||
| import { queryKey } from '../../constants/queryKey'; | ||
| import type { RequestExternalListDto } from '../../types/external'; | ||
| import type { CommonResponse } from '../../types/common'; | ||
| import { axiosInstance } from '../axios'; | ||
|
|
||
| // external/externalHome.tsx | ||
| export const deleteExternalItem = async ({ | ||
| teamId, | ||
| externalIds, | ||
| }: RequestExternalListDto): Promise<CommonResponse> => { | ||
| try { | ||
| const { data } = await axiosInstance.delete(`/api/teams/${teamId}/externals`, { | ||
| data: externalIds, | ||
| }); | ||
|
|
||
| return data; | ||
| } catch (error) { | ||
| console.error('Error deleting external item:', error); | ||
| throw error; | ||
| } | ||
| }; | ||
|
|
||
| export const useDeleteExternals = () => { | ||
| return useMutation({ | ||
| mutationFn: deleteExternalItem, | ||
| onSuccess(data, variables) { | ||
| console.log('Externals deleted successfully:', data); | ||
| queryClient.invalidateQueries({ | ||
| queryKey: [queryKey.EXTERNAL_LIST, variables.teamId], | ||
| }); | ||
| }, | ||
| }); | ||
| }; |
This file contains hidden or 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,30 @@ | ||
| import { useQuery } from '@tanstack/react-query'; | ||
| import { queryKey } from '../../constants/queryKey'; | ||
| import type { PaginationDto } from '../../types/common'; | ||
| import type { RequestExternalListDto, ResponseExternalDto } from '../../types/external'; | ||
| import { axiosInstance } from '../axios'; | ||
|
|
||
| // external/externalHome.tsx | ||
| const getExternalList = async ( | ||
| { teamId }: RequestExternalListDto, | ||
| paginationDto: PaginationDto | ||
| ): Promise<ResponseExternalDto> => { | ||
| try { | ||
| const { data } = await axiosInstance.get(`/api/teams/${teamId}/externals`, { | ||
| params: paginationDto, | ||
| }); | ||
|
|
||
| console.log('외부 연동 리스트 데이터 불러오기 성공', data); | ||
| return data; | ||
| } catch (error) { | ||
| console.error('Error fetching external list:', error); | ||
| throw error; | ||
| } | ||
| }; | ||
|
|
||
| export const useGetExternalList = (teamId: string, params: PaginationDto) => { | ||
| return useQuery({ | ||
| queryKey: [queryKey.EXTERNAL_LIST, teamId, params], | ||
| queryFn: () => getExternalList({ teamId }, params), | ||
| }); | ||
| }; |
This file contains hidden or 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 hidden or 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,32 @@ | ||
| import { useMutation } from '@tanstack/react-query'; | ||
| import queryClient from '../../utils/queryClient'; | ||
| import { queryKey } from '../../constants/queryKey'; | ||
| import type { RequestGoalListDto } from '../../types/goal'; | ||
| import type { CommonResponse } from '../../types/common'; | ||
| import { axiosInstance } from '../axios'; | ||
|
|
||
| // goal/GoalHome.tsx | ||
| const deleteGoalItem = async ({ teamId, goalIds }: RequestGoalListDto): Promise<CommonResponse> => { | ||
| try { | ||
| const { data } = await axiosInstance.delete(`/api/teams/${teamId}/goals`, { | ||
| data: { goalIds }, | ||
| }); | ||
|
|
||
| return data; | ||
| } catch (error) { | ||
| console.error('Error deleting goal item:', error); | ||
| throw error; | ||
| } | ||
| }; | ||
|
|
||
| export const useDeleteGoals = () => { | ||
| return useMutation({ | ||
| mutationFn: deleteGoalItem, | ||
| onSuccess(data, variables) { | ||
| console.log('Goals deleted successfully:', data); | ||
| queryClient.invalidateQueries({ | ||
| queryKey: [queryKey.GOAL_LIST, variables.teamId], | ||
| }); | ||
| }, | ||
| }); | ||
| }; |
This file contains hidden or 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,29 @@ | ||
| import { useQuery } from '@tanstack/react-query'; | ||
| import { queryKey } from '../../constants/queryKey'; | ||
| import type { PaginationDto } from '../../types/common'; | ||
| import type { RequestGoalListDto, ResponseGoalDto } from '../../types/goal'; | ||
| import { axiosInstance } from '../axios'; | ||
|
|
||
| // goal/GoalHome.tsx | ||
| const getGoalList = async ( | ||
| { teamId }: RequestGoalListDto, | ||
| paginationDto: PaginationDto | ||
| ): Promise<ResponseGoalDto> => { | ||
| try { | ||
| const { data } = await axiosInstance.get(`/api/teams/${teamId}/goals`, { | ||
| params: paginationDto, | ||
| }); | ||
|
|
||
| return data; | ||
| } catch (error) { | ||
| console.error('Error fetching goal list:', error); | ||
| throw error; | ||
| } | ||
| }; | ||
|
|
||
| export const useGetGoalList = (teamId: string, params: PaginationDto) => { | ||
| return useQuery({ | ||
| queryKey: [queryKey.GOAL_LIST, teamId, params], | ||
| queryFn: () => getGoalList({ teamId }, params), | ||
| }); | ||
| }; | ||
This file contains hidden or 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,35 @@ | ||
| import { useMutation } from '@tanstack/react-query'; | ||
| import queryClient from '../../utils/queryClient'; | ||
| import { queryKey } from '../../constants/queryKey'; | ||
| import type { RequestIssueListDto } from '../../types/issue'; | ||
| import type { CommonResponse } from '../../types/common'; | ||
| import { axiosInstance } from '../axios'; | ||
|
|
||
| //issue/IssueHome.tsx | ||
| const deleteIssueItem = async ({ | ||
| teamId, | ||
| issueIds, | ||
| }: RequestIssueListDto): Promise<CommonResponse> => { | ||
| try { | ||
| const { data } = await axiosInstance.delete(`/api/teams/${teamId}/issues`, { | ||
| data: { issueIds }, | ||
| }); | ||
|
|
||
| return data; | ||
| } catch (error) { | ||
| console.error('Error deleting issue item:', error); | ||
| throw error; | ||
| } | ||
| }; | ||
|
|
||
| export const useDeleteIssues = () => { | ||
| return useMutation({ | ||
| mutationFn: deleteIssueItem, | ||
| onSuccess(data, variables) { | ||
| console.log('Issues deleted successfully:', data); | ||
| queryClient.invalidateQueries({ | ||
| queryKey: [queryKey.ISSUE_LIST, variables.teamId], | ||
| }); | ||
| }, | ||
| }); | ||
| }; |
This file contains hidden or 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,29 @@ | ||
| import { useQuery } from '@tanstack/react-query'; | ||
| import { queryKey } from '../../constants/queryKey'; | ||
| import type { PaginationDto } from '../../types/common'; | ||
| import type { RequestIssueListDto, ResponseIssueDto } from '../../types/issue'; | ||
| import { axiosInstance } from '../axios'; | ||
|
|
||
| //issue/IssueHome.tsx | ||
| const getIssueList = async ( | ||
| { teamId }: RequestIssueListDto, | ||
| paginationDto: PaginationDto | ||
| ): Promise<ResponseIssueDto> => { | ||
| try { | ||
| const { data } = await axiosInstance.get(`/api/teams/${teamId}/issues`, { | ||
| params: paginationDto, | ||
| }); | ||
|
|
||
| return data; | ||
| } catch (error) { | ||
| console.error('Error fetching issue list:', error); | ||
| throw error; | ||
| } | ||
| }; | ||
|
|
||
| export const useGetIssueList = (teamId: string, params: PaginationDto) => { | ||
| return useQuery({ | ||
| queryKey: [queryKey.ISSUE_LIST, teamId, params], | ||
| queryFn: () => getIssueList({ teamId }, params), | ||
| }); | ||
| }; |
This file contains hidden or 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 hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
P2: useInfiniteQuery 사용해서 무한 스크롤로 구현하는게 좋지 않을까요?