Skip to content

Commit

Permalink
feat: ์ˆ˜์ •
Browse files Browse the repository at this point in the history
  • Loading branch information
minji2219 committed Nov 15, 2024
1 parent 76cd3eb commit 3cb11ce
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 9 deletions.
5 changes: 4 additions & 1 deletion src/components/OrderHistoryDetail/OrderDetailCreater.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,10 @@ const OrderDetailCreater = ({ spotId }: OrderDetailCreaterProps) => {
//@ts-ignore
modify={modifyData}
onRequestClose={() => setRecruitIsOpen(false)}
onRequestConfirm={() => setCompleteModalIsOpen(true)}
onRequestConfirm={() => {
setRecruitIsOpen(false);
setCompleteModalIsOpen(true);
}}
//TODO์ž„์‹œ
onRequestError={() => {}}
/>
Expand Down
4 changes: 2 additions & 2 deletions src/components/OrderHistoryDetail/OrderDetailMember.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ const OrderDetailMember = () => {
const [price, setPrice] = useState<number>(0);
const navigate = useNavigate();
const deleteSpot = () => {
fetchAuthInstance.delete(`/orders/${orderId}`).then((response) => {
fetchAuthInstance.delete(`/orders/delete/${orderId}`).then((response) => {
if (response.status === 200) {
window.history.back();
navigate(RouterPath.myPageOrderHistory);
}
});
};
Expand Down
10 changes: 5 additions & 5 deletions src/pages/PaymentPage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@ import InputField from '@components/common/InputField';
import { Common } from '@styles/globalStyle';
import { fetchInstance } from '@api/instance/index';
import Cookies from 'js-cookie';
import { useLocation } from 'react-router-dom';
import { usePostIsPayed } from '@api/hooks/usePostIspayed';
import { useLocation, useNavigate } from 'react-router-dom';
import { usePostPayPrice } from '@api/hooks/usePostpayPrice';
import { RouterPath } from '@routes/path';

const PaymentPage: React.FC = () => {
const location = useLocation();
const { mutate: postIsPayed } = usePostIsPayed();
const { mutate: postPayPrice } = usePostPayPrice();
const [paymentAmount, setPaymentAmount] = useState<number>(
location.state.price || 0,
);
const [loading, setLoading] = useState(false);
const [refreshKey, setRefreshKey] = useState(0);
const navigate = useNavigate();

const handlePaymentChange = (e: React.ChangeEvent<HTMLInputElement>) => {
const { value } = e.target;
Expand Down Expand Up @@ -55,12 +55,12 @@ const PaymentPage: React.FC = () => {
)
.then(async () => {
alert('๊ฒฐ์ œ๊ฐ€ ์™„๋ฃŒ๋˜์—ˆ์Šต๋‹ˆ๋‹ค.');
postIsPayed({ orderId: location.state.orderId });
await postPayPrice({
postPayPrice({
orderId: location.state.orderId,
price: location.state.price,
});
setPaymentAmount(0);
navigate(RouterPath.myPageOrderHistory);
setRefreshKey((prev) => prev + 1);
})
.catch((error) => {
Expand Down
2 changes: 1 addition & 1 deletion src/pages/SignupPage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ const SignupPage: React.FC = () => {
<Modal
isOpen={isOpen}
onRequestClose={() => setIsOpen(false)}
title="[์—ฌ๊ธฐ๋จน๋•Œ] ๋งˆ์ผ€ํŒ… ์ •๋ณด ์ˆ˜์‹  ๋™์˜"
title="[์š”๊ธฐ๋จน๋•Œ] ๋งˆ์ผ€ํŒ… ์ •๋ณด ์ˆ˜์‹  ๋™์˜"
content={
<AlertDialog
content={
Expand Down

0 comments on commit 3cb11ce

Please sign in to comment.