diff --git a/src/apis/Pay/PayPageAPI.ts b/src/apis/Pay/PayPageAPI.ts
index e4cdce0..963671e 100644
--- a/src/apis/Pay/PayPageAPI.ts
+++ b/src/apis/Pay/PayPageAPI.ts
@@ -7,7 +7,7 @@ import {
} from "@/apis/_createRequestOptions";
import { BankInfo, ChatUserInfoInSpace } from "@/pages/PayPage/CreateRequestPage";
import { useNavigate } from "react-router-dom";
-import { UserInfoInSpace } from "../SpaceSearchAllUserApi";
+import { UserInfoInSpace } from "@/apis/Space/SpaceSearchAllUserApi";
interface SpaceSearchAllUserApiResponseType {
code: number;
@@ -100,12 +100,12 @@ export const payHomeApi = async (
const response = await fetchPayApi(
`${import.meta.env.VITE_API_BACK_URL}/space/${spaceID}/pay`,
requestOptions,
+ ).then((res) =>
+ res?.json?.().then((data: any) => {
+ setReqData(data.result.payRequestInfoDtoList);
+ setRecData(data.result.payReceiveInfoDtoList);
+ }),
);
-
- response.json().then((data) => {
- setReqData(data.result.payRequestInfoDtoList);
- setRecData(data.result.payReceiveInfoDtoList);
- });
};
export const recentAccountApi = async (
diff --git a/src/pages/PayPage/CreatePayComponents.tsx b/src/pages/PayPage/CreatePayComponents.tsx
index 3bdfaef..11ee08a 100644
--- a/src/pages/PayPage/CreatePayComponents.tsx
+++ b/src/pages/PayPage/CreatePayComponents.tsx
@@ -5,7 +5,7 @@ import { useState } from "react";
import * as s from "@/pages/PayPage/PayPage.styled";
import { ChatUserInfoInSpace } from "./CreateRequestPage";
-import { UserInfoInSpace } from "@/apis/SpaceSearchAllUserApi";
+import { UserInfoInSpace } from "@/apis/Space/SpaceSearchAllUserApi";
interface payChatDivtype {
img: string;
name: string;
diff --git a/src/pages/PayPage/CreateRequestPage.tsx b/src/pages/PayPage/CreateRequestPage.tsx
index f7e9484..2533f96 100644
--- a/src/pages/PayPage/CreateRequestPage.tsx
+++ b/src/pages/PayPage/CreateRequestPage.tsx
@@ -373,7 +373,10 @@ const CreateRequestPage3 = ({
{value.userName}
- {Number.parseInt(nPrice / tempArr.length)}
+
+ {" "}
+ {nPrice !== undefined ? nPrice / tempArr.length : "NaN"}
+
원
@@ -422,7 +425,9 @@ const CreateRequestPage3 = ({
onClick={() => {
if (tabIndex === 0) {
nPriceHandler();
- setTotalPrice(nPrice);
+ if (nPrice !== undefined) {
+ setTotalPrice(nPrice);
+ }
} else {
setTotalPrice(_totalPrice);
}