-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* ✨ #271 - 매칭 종료 후 매칭 설문 페이지 redirection 처리 및 매칭 이력 조회 API 연동 * 🐛 #271 - 매칭 중 상대방이 의도하지 않은 방법으로 통신을 종료하는 경우 이벤트 추가 * ✨ #271 - 피드백 생성 API 적용 * ✨ #271 - 매칭 후 블랙리스트 등록 API 연동 * 🩹 #271 - 매칭 피드백 완료 후 메인 이동 시 뒤로가기 못하도록 replace로 변경 * 🩹 #271 - 매칭 피드백 생성 axios 인스턴스 코드 포맷 통일 관련 작업 * ✏️ #271 - 블랙리스트 추가 관련 API 메소드 명 변경 * 🏷️ #271 - 매칭 히스토리 조회 응답 타입 수정 * fix: 구조분해 할당 데이터 위치 변경 #271 * fix: form 안에 있는 인터렉션 태그들 react hook form 하나로 관리 #271
- Loading branch information
Showing
14 changed files
with
188 additions
and
24 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,14 @@ | ||
import type { OnlyMessageResponse, SuccessResponse } from 'types/response'; | ||
|
||
import { API_PATH } from 'constants/services'; | ||
import axios from 'lib/axios'; | ||
|
||
export const addToBlackList = async (blockedUserId: string) => { | ||
const { | ||
data: { data }, | ||
} = await axios.post<SuccessResponse<OnlyMessageResponse>>( | ||
API_PATH.blacklist.addToBlackList(blockedUserId), | ||
); | ||
|
||
return data.message; | ||
}; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import type { | ||
CreateMatchingFeedbackRequest, | ||
CreateMatchingFeedbackResponse, | ||
MatchingHistoryResponse, | ||
} from 'types/matching'; | ||
import type { SuccessResponse } from 'types/response'; | ||
|
||
import { API_PATH } from 'constants/services'; | ||
import axios from 'lib/axios'; | ||
|
||
export const getRecentMatchingHistory = async () => { | ||
const { | ||
data: { data }, | ||
} = await axios.get<SuccessResponse<MatchingHistoryResponse>>( | ||
API_PATH.matchingHistories.recent, | ||
); | ||
|
||
return data; | ||
}; | ||
|
||
export const createMatchingFeedback = async ( | ||
payload: CreateMatchingFeedbackRequest, | ||
) => { | ||
const { matchingHistoryId, ...feedbackForm } = payload; | ||
|
||
const { | ||
data: { data }, | ||
} = await axios.post<SuccessResponse<CreateMatchingFeedbackResponse>>( | ||
API_PATH.matchingHistories.feedback(matchingHistoryId), | ||
feedbackForm, | ||
); | ||
|
||
return data; | ||
}; |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { useMutation } from '@tanstack/react-query'; | ||
import * as api from 'api'; | ||
|
||
export const useAddToBlackList = () => { | ||
return useMutation( | ||
async (blockedUserId: string) => await api.addToBlackList(blockedUserId), | ||
); | ||
}; |
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,11 @@ | ||
import { useMutation } from '@tanstack/react-query'; | ||
|
||
import type { CreateMatchingFeedbackRequest } from 'types/matching'; | ||
import * as api from 'api'; | ||
|
||
export const useCreateMatchingFeedback = () => { | ||
return useMutation( | ||
async (payload: CreateMatchingFeedbackRequest) => | ||
await api.createMatchingFeedback(payload), | ||
); | ||
}; |
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,13 @@ | ||
import { useQuery } from '@tanstack/react-query'; | ||
import * as api from 'api'; | ||
|
||
import { queryKeys } from 'constants/services'; | ||
|
||
export const useRecentMatchingHistory = () => { | ||
const response = useQuery( | ||
[queryKeys.recentMatchingHistory], | ||
async () => await api.getRecentMatchingHistory(), | ||
); | ||
|
||
return response; | ||
}; |
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