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

[Sprint] 일대다상담 상담 댓글 id를 이용한 시나리오 제외 모든 api 연동 #218

Merged
merged 9 commits into from
Apr 15, 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
13 changes: 9 additions & 4 deletions src/Router.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ import { BuyerOpenConsultRequest } from 'pages/Buyer/BuyerOpenConsultRequest';
import { BuyerOpenPaymentDetail } from 'pages/Buyer/BuyerOpenPaymentDetail';
import BuyerWriteOpenConsult from 'pages/Buyer/BuyerWriteOpenConsult';
import BuyerOpenConsultDetail from 'pages/Buyer/BuyerOpenConsultDetail';
import BuyerOpenConsultSection from 'components/Buyer/BuyerConsult/BuyerOpenConsultSection';
import BuyerFinishPayment from 'pages/Buyer/BuyerFinishPayment';
const Router = () => {
return (
Expand All @@ -73,11 +72,14 @@ const Router = () => {
<Route path="/openConsultRequest" element={<BuyerOpenConsultRequest />} />

<Route path="/openPaymentDetail" element={<BuyerOpenPaymentDetail />} />
<Route path="/writeOpenConsult" element={<BuyerWriteOpenConsult />} />
<Route
path="/writeOpenConsult/:postId"
element={<BuyerWriteOpenConsult />}
/>

<Route path="/paymentDetail/:id" element={<BuyerPaymentDetail />} />
<Route path="/paymentComplete" element={<BuyerPaymentComplete />} />
<Route path="/paymentFinish" element={<BuyerFinishPayment/>} />
<Route path="/paymentFinish" element={<BuyerFinishPayment />} />
<Route path="/counselors" element={<BuyerAvailCounselor />} />
<Route path="/mypage" element={<BuyerMypage />} />
<Route path="/reviewManage" element={<BuyerReviewManage />} />
Expand Down Expand Up @@ -125,7 +127,10 @@ const Router = () => {
/>

<Route path="/minder/consult" element={<SellerConsult />} />
<Route path="/minder/open-consult" element={<SellerOpenConsult />} />
<Route
path="/minder/open-consult/:consultid"
element={<SellerOpenConsult />}
/>
{/* 판매자 : 프로필 정보 */}
<Route path="/minder/mypage" element={<SellerMypage />} />

Expand Down
12 changes: 12 additions & 0 deletions src/api/delete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,15 @@ export const deleteSearchWords = async (body: any) =>
//검색 결과 반환
export const deleteWishLists = async (counselorId: number) =>
await deleteInstance(`/wishLists?counselorId=${counselorId}`);

// 일대다상담
// CommentLike Controller
export const deleteCommentLikes = async (commentId: any) =>
await deleteInstance(`/commentLikes/${commentId}`);
// PostLike Controller
export const deletePostLikes = async (postId: any) =>
await deleteInstance(`/postLikes/${postId}`);

// PostScrap Controller
export const deletePostScraps = async (postId: any) =>
await deleteInstance(`/postScraps/${postId}`);
40 changes: 39 additions & 1 deletion src/api/get.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import { getInstance, getPublicInstance } from './axios';
//admin
export const getAdminsUnpaidConsults = async () =>
await getInstance('/admins/unpaid-consults');
export const getAdminsUnpaidPosts = async () =>
await getInstance(`/admins/unpaid-posts`);
export const getAdminsPedningProfilse = async () =>
await getInstance('/admins/pending-profiles');
export const getAdminsRefundWaiting = async () =>
Expand Down Expand Up @@ -104,7 +106,7 @@ export const getPaymentsCustomers = async (params: any) =>

export const getCounselorsAccount = async () =>
await getInstance('/counselors/account');

export const getPaymentsMinder = async (params: any) =>
await getInstance('/payments/counselors', params);

Expand All @@ -116,3 +118,39 @@ export const getMinderReviews = async (params: any) =>
await getInstance('/reviews/counselors', params);
export const getMinderReviewsHome = async () =>
await getInstance('/reviews/counselors/home');

// 일대다상담 컨트롤러

// Comment Controller

export const getCounselorsComments = async (postId: any) =>
await getInstance(`/comments/counselors/${postId}`);
export const getCustomersComments = async (postId: any) =>
await getInstance(`/comments/customers/${postId}`);

// Post Controller
export const getOneOpenConsult = async (id: string | undefined) =>
await getInstance(`/posts/${id}`);

export const getCounselorsOpenConsultList = async (params: any) =>
await getInstance(`/posts/counselors`, params);
export const getCounselorsOneConsult = async (postId: any) =>
await getInstance(`/posts/counselors/${postId}`);

export const getCounselorsRandomConsult = async () =>
await getInstance(`/posts/counselors/random`);

export const getCustomerOpenConsultList = async (params: any) =>
await getInstance('/posts/customers', params);

export const getCustomerPopularConsultList = async (params: any) =>
await getInstance('/posts/customers/public/likes', params);

export const getCustomerPublicConsultList = async (params: any) =>
await getInstance('/posts/customers/public', params);

export const getCustomerIsWriter = async (postId: any) =>
await getInstance(`/posts/customers/public/${postId}`);

export const getOpenConsultDraft = async (postId: any) =>
await getInstance(`/posts/drafts/${postId}`);
15 changes: 15 additions & 0 deletions src/api/patch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ import { patchInstance, patchPublicInstance } from './axios';
//admin 미결제 상담 승인
export const patchAdminsUnpaidConsults = async (consultId: number) =>
await patchInstance(`/admins/unpaid-consults/${consultId}`);

export const patchAdminsUnpaidPosts = async (postId: number) =>
await patchInstance(`/admins/unpaid-posts/${postId}`);
//admin 프로필 수정 승인
export const patchAdminsPendingProfiles = async (
counselorId: number,
Expand Down Expand Up @@ -68,3 +71,15 @@ export const patchSearchWordsResults = async (sortType: string, body: any) =>
//찜하기 추가
export const patchWishLists = async (counselorId: number) =>
await patchInstance(`/wishLists?counselorId=${counselorId}`);

//일대다상담

//Comment Controller

export const patchAdoptComment = async (postId: any, params: any) =>
await patchInstance(`/comments/customers/${postId}`, params);

//Post Controller
export const patchOpenConsult = async (body: any) => {
await patchInstance(`/posts`, body);
};
24 changes: 24 additions & 0 deletions src/api/post.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,27 @@ export const postIsPassQuiz = async (body: any, parmas: any) =>
//찜하기 목록 가져오기
export const postWishLists = async (body: any) =>
await postInstance('/wishLists', body);

// 일대다상담

// Comment Controller
export const postComment = async (body) =>
await postInstance('/comments/counselors', body);

// CommentLike Controller

export const postLikeComment = async (commentId: any) =>
await postInstance(`/commentLikes/${commentId}`, {});

// Post Controller
export const postOpenConsult = async (body: any) =>
await postInstance('/posts', body);

// PostLike Controller

export const postLikeOpenConsult = async (postId: any) =>
await postInstance(`/postLikes/${postId}`, {});

// PostScrap Controller
export const postScrapOpenConsult = async (postId: any) =>
await postInstance(`/postScraps/${postId}`, {});
5 changes: 5 additions & 0 deletions src/assets/icons/icon-green-check.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading