Skip to content

Commit

Permalink
Merge pull request #221 from sharemindteam/sprint/one_to_many_consult
Browse files Browse the repository at this point in the history
[Sprint] 일대다상담 api 연동 끝
  • Loading branch information
kyuhho authored Apr 16, 2024
2 parents 901ef5a + 21e180a commit c68f5c9
Show file tree
Hide file tree
Showing 67 changed files with 3,678 additions and 300 deletions.
21 changes: 20 additions & 1 deletion src/Router.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ import { BuyerQuit } from 'pages/Buyer/BuyerQuit';
import SellerChat from 'pages/Seller/SellerChat';
import BuyerOpenConsult from 'pages/Buyer/BuyerOpenConsult';
import SellerOpenConsult from 'pages/Seller/SellerOpenConsult';
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 BuyerFinishPayment from 'pages/Buyer/BuyerFinishPayment';
const Router = () => {
return (
<Routes>
Expand All @@ -56,13 +61,24 @@ const Router = () => {
<Route path="/" element={<BuyerHome />} />
<Route path="/consult" element={<BuyerConsult />} />
<Route path="/open-consult" element={<BuyerOpenConsult />} />
<Route path="/open-consult/:id" element={<BuyerOpenConsultDetail />} />
<Route path="/profile/:id" element={<BuyerCounselorProfile />} />
<Route path="/search" element={<BuyerSearch />} />
<Route path="/categorySearch" element={<BuyerCategoryResult />} />
<Route path="/search/result" element={<BuyerSearchResult />} />
<Route path="/consultRequest" element={<BuyerConsultRequest />} />

<Route path="/openConsultRequest" element={<BuyerOpenConsultRequest />} />

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

<Route path="/paymentDetail/:id" element={<BuyerPaymentDetail />} />
<Route path="/paymentComplete" element={<BuyerPaymentComplete />} />
<Route path="/paymentFinish" element={<BuyerFinishPayment />} />
<Route path="/counselors" element={<BuyerAvailCounselor />} />
<Route path="/mypage" element={<BuyerMypage />} />
<Route path="/reviewManage" element={<BuyerReviewManage />} />
Expand Down Expand Up @@ -110,7 +126,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}`);
41 changes: 41 additions & 0 deletions src/api/get.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import { getInstance, getPublicInstance } from './axios';
*/
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 @@ -121,6 +123,9 @@ export const getCounselorsChats = async (chatId: string, params: any) =>
export const getPaymentsCustomers = async (params: any) =>
await getInstance('/payments/customers', params);

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

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

Expand All @@ -134,3 +139,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 () =>
await getPublicInstance('/posts/customers/public/likes');

export const getCustomerPublicConsultList = async (params: any) =>
await getPublicInstance('/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}`);
19 changes: 19 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 @@ -39,6 +42,10 @@ export const patchCounselorsAll = async (sortType: string, body: any) =>
//Message 최초 생성
export const patchLetterMessage = async (body: any) =>
await patchInstance('/letterMessages', body);

export const patchCounselorsAccount = async (body: any) =>
await patchInstance('/counselors/account', body);

//Message 최초 생성 (first-question)
export const patchLetterMessageFirstQustion = async (body: any) =>
await patchInstance('/letterMessages/first-question', body);
Expand All @@ -64,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, commentId: string) =>
await patchInstance(`/comments/customers/${postId}?commentId=${commentId}`);

//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-fire.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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.
4 changes: 4 additions & 0 deletions src/assets/icons/icon-write.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit c68f5c9

Please sign in to comment.