Skip to content

Commit

Permalink
Merge pull request #229 from ODOICHON/feat/#228
Browse files Browse the repository at this point in the history
feat: ๋นˆ์ง‘๊ฑฐ๋ž˜ ๊ฒŒ์‹œ๊ธ€ ์ƒ์„ฑ API ๋ช…์„ธ์„œ ๋ฐ”๋€œ์— ๋”ฐ๋ผ ์ฝ”๋“œ ์ˆ˜์ •
  • Loading branch information
JunJongHun authored Feb 12, 2024
2 parents d443fed + de122f6 commit 88e882e
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 17 deletions.
28 changes: 14 additions & 14 deletions src/Routes.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
import { lazy } from 'react';
import { RouteObject } from 'react-router-dom';
import GlobalLayout from '@/pages/_layout';
import MyPage from './pages/Mypage';
import MyCommentsPage from './pages/Mypage/community/comments';
import MyPage from './pages/MyPage';
import MyCommentsPage from './pages/MyPage/community/comments';

import MyLikesPage from './pages/Mypage/community/likes';
import MyWritePage from './pages/Mypage/community/write';
import MyHomePage from './pages/Mypage/home';
import MySettingsPage from './pages/Mypage/setting';
import CertificateMember from './pages/Mypage/setting/CertificateMember';
import EditMember from './pages/Mypage/setting/EditMember';
import EditPassword from './pages/Mypage/setting/EditPassword';
import WithdrawalFromMembership from './pages/Mypage/setting/WithdrawalFromMembership';
import MySelfPage from './pages/Mypage/trade/myself';
import MySavesPage from './pages/Mypage/trade/saves';
import MyScrapPage from './pages/Mypage/trade/scrap';
import MyLikesPage from './pages/MyPage/community/likes';
import MyWritePage from './pages/MyPage/community/write';
import MyHomePage from './pages/MyPage/home';
import MySettingsPage from './pages/MyPage/setting';
import CertificateMember from './pages/MyPage/setting/CertificateMember';
import EditMember from './pages/MyPage/setting/EditMember';
import EditPassword from './pages/MyPage/setting/EditPassword';
import WithdrawalFromMembership from './pages/MyPage/setting/WithdrawalFromMembership';
import MySelfPage from './pages/MyPage/trade/myself';
import MySavesPage from './pages/MyPage/trade/saves';
import MyScrapPage from './pages/MyPage/trade/scrap';

const MainPage = lazy(() => import('@/pages/Main'));
const LoginPage = lazy(() => import('@/pages/Login'));
Expand Down Expand Up @@ -43,7 +43,7 @@ export const routes: RouteObject[] = [
{ path: 'signup', element: <SignUpPage /> },
{ path: 'agentSignup', element: <AgentSignUpPage /> },
{
path: 'mypage',
path: 'myPage',
element: <MyPage />,
children: [
{
Expand Down
5 changes: 4 additions & 1 deletion src/components/Trade/Quill/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,10 @@ export default function TradeQuill({
};

if (!isTempSave) {
if (!checkBeforeTradePost(user!, newForm)) return;
if (!checkBeforeTradePost(user!, newForm)) {
setIsProcessing(false);
return;
}
}

try {
Expand Down
16 changes: 14 additions & 2 deletions src/pages/Trade/Write/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export default function TradeWritePage() {
rentalType: state ? state.data.rentalType : 'SALE',
city: state ? state.data.city : '',
zipCode: state ? state.data.zipCode : '',
detail: state ? state.data.detail : '',
size: state ? state.data.size : '',
purpose: state ? state.data.purpose : '',
floorNum: state ? state.data.floorNum : 0,
Expand Down Expand Up @@ -203,14 +204,25 @@ export default function TradeWritePage() {
์šฐํŽธ๋ฒˆํ˜ธ
</label>
<input
id="์ƒ์„ธ ์ฃผ์†Œ"
id="์šฐํŽธ๋ฒˆํ˜ธ"
type="text"
placeholder="์ƒ์„ธ์ฃผ์†Œ"
placeholder="์šฐํŽธ๋ฒˆํ˜ธ"
name="zipCode"
readOnly
value={form.zipCode}
/>
</div>
<div>
<label htmlFor="์ƒ์„ธ์ฃผ์†Œ">์ƒ์„ธ์ฃผ์†Œ</label>
<input
id="์ƒ์„ธ์ฃผ์†Œ"
type="text"
placeholder="์ƒ์„ธ์ฃผ์†Œ ์ž…๋ ฅ"
name="detail"
onChange={onChangeForm}
value={form.detail}
/>
</div>
<div>
<label htmlFor="์ž„๋Œ€ ๊ฐ€๊ฒฉ">
{getRentalPriceType(form.rentalType)}
Expand Down
2 changes: 2 additions & 0 deletions src/types/Board/tradeType.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export type TradeBoardForm = {
rentalType: RentalType;
city: string;
zipCode: string;
detail: string;
size: string;
purpose: string;
floorNum: number;
Expand Down Expand Up @@ -52,6 +53,7 @@ export type TradeBoardDetailType = {
rentalType: RentalType;
city: string;
zipCode: string;
detail: string;
size: string;
purpose: string;
floorNum: number;
Expand Down
5 changes: 5 additions & 0 deletions src/utils/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ export const checkBeforeTradePost = (
imageUrls,
city,
zipCode,
detail,
price,
monthlyPrice,
contact,
Expand All @@ -160,6 +161,10 @@ export const checkBeforeTradePost = (
alert('์šฐํŽธ๋ฒˆํ˜ธ๋ฅผ ์ž…๋ ฅํ•ด์ฃผ์„ธ์š”.');
return false;
}
if (detail === '') {
alert('์ƒ์„ธ์ฃผ์†Œ๋ฅผ ์ž…๋ ฅํ•ด์ฃผ์„ธ์š”.');
return false;
}
if (price === 0) {
alert('๋งค๋งค๊ฐ€๋ฅผ ์ž…๋ ฅํ•ด์ฃผ์„ธ์š”.');
return false;
Expand Down

0 comments on commit 88e882e

Please sign in to comment.