-
setIntreasteactiveTab("receivedintreaste")}>
-
- Received Interest
-
-
- Manage your matrimony profile interests
-
+
navigate(`/profile-details/${profile.id}`)}
+ className="bg-white rounded-xl shadow-sm border border-gray-200 overflow-hidden hover:shadow-md transition-shadow cursor-pointer p-4"
+ >
+
+ {/* Profile Image */}
+
+

+ {profile.is_paid_member && (
+
+
+
+ )}
-
setIntreasteactiveTab("sendintreaste")}>
-
- Send Interest
-
-
- Manage your matrimony profile interests
-
+
+ {/* Profile Info */}
+
+
+
{profile.name}
+
+
+
+
+
+ ID: {profile.member_id}
+
+
+ {profile.last_seen_at}
+
+
+
+
+
+ {profile.district_name}, {profile.state_name}
+
+
+
+
+ {profile.age || "N/A"} yrs • {profile.height || "N/A"} ft
+
+
+
+
+ {profile.religion_name} / {profile.caste_name}
+
+
+ {profile.annual_income_name && (
+
+
+ {profile.annual_income_name}
+
+ )}
+
-
- {intreasteactiveTab === "receivedintreaste" && (
+
-<>
-
- {/* MUI Tabs */}
-
-
-
+ {tabIndex === 0 && profile.statusReceived === 'pending' ? (
+ <>
+
-
- {/* Received Requests */}
-
-
- {profilesData.received.map((profile) => (
-
- ))}
-
-
-
- {/* Sent Requests */}
-
-
- {profilesData.sent.map((profile) => (
-
- ))}
-
-
-
- {/* Accepted */}
-
-
- {profilesData.accepted.map((profile) => (
-
- ))}
-
-
-
- {/* Rejected */}
-
-
- {profilesData.rejected.map((profile) => (
-
- ))}
-
-
-
-
-
-
->
- )}
-
-
-
-
- {intreasteactiveTab === "sendintreaste" && (
-
-<>
-
- {/* MUI Tabs */}
-
-
- Reject Request
+
+
-
- {/* Received Requests */}
-
-
- {profilesData.received.map((profile) => (
-
- ))}
-
-
-
- {/* Sent Requests */}
-
-
- {profilesData.sent.map((profile) => (
-
- ))}
-
-
-
- {/* Accepted */}
-
-
- {profilesData.accepted.map((profile) => (
-
- ))}
-
-
-
- {/* Rejected */}
-
-
- {profilesData.rejected.map((profile) => (
-
- ))}
-
-
-
-
-
-
->
- )}
-
-
-
+
Accept Request
+
+ >
+ ) : (tabIndex === 1 || tabIndex === 2 || (tabIndex === 0 && profile.statusReceived === 'accept')) ? (
+ <>
+
+
+ >
+ ) : null}
);
-}
+};
+
+export default InterestSendPage;
diff --git a/src/pages/ProfileDetailPage.jsx b/src/pages/ProfileDetailPage.jsx
index 0857d04..aa8c914 100644
--- a/src/pages/ProfileDetailPage.jsx
+++ b/src/pages/ProfileDetailPage.jsx
@@ -1,19 +1,58 @@
+import React, { useState, useEffect } from 'react';
import { useParams } from "react-router-dom";
import MatrimonyProfile from "../components/profiledetail/MatrimonyProfile"
import PartnerPreferences from "../components/profiledetail/PartnerPreferences"
import MatchingList from "../components/profiledashboard/MatchingList";
+import { getProfileDetail } from "../services/profileActionApi";
+import { CircularProgress, Box } from "@mui/material";
const ProfileDetailPage = () => {
const { id } = useParams();
+ const [data, setData] = useState(null);
+ const [loading, setLoading] = useState(true);
+
+ useEffect(() => {
+ const fetchDetail = async () => {
+ setLoading(true);
+ try {
+ const res = await getProfileDetail(id);
+ setData(res);
+ } catch (error) {
+ console.error("Failed to fetch profile details:", error);
+ } finally {
+ setLoading(false);
+ }
+ };
+ if (id) {
+ fetchDetail();
+ }
+ }, [id]);
+
+ if (loading) {
+ return (
+
+
+
+ );
+ }
+
+ if (!data) {
+ return (
+
+ Profile details not found.
+
+ );
+ }
+
return (
<>
>
- )
-}
+ );
+};
-export default ProfileDetailPage
\ No newline at end of file
+export default ProfileDetailPage;
\ No newline at end of file
diff --git a/src/pages/auth/LoginPage.jsx b/src/pages/auth/LoginPage.jsx
index 0119a95..c898c0c 100644
--- a/src/pages/auth/LoginPage.jsx
+++ b/src/pages/auth/LoginPage.jsx
@@ -74,6 +74,13 @@ const LoginPage = () => {
localStorage.setItem("access_token", token);
setAccessToken(token);
+ // Store profile_id and user_id for WebSocket channels
+ const profileId = data?.profile_id || data?.data?.profile_id;
+ const userId = data?.user_id || data?.data?.user_id;
+
+ if (profileId) localStorage.setItem("profile_id", profileId);
+ if (userId) localStorage.setItem("user_id", userId);
+
toast.success("Login Successful!");
navigate("/dashboard-home");
} else {
diff --git a/src/redux/registrationFormSlice.jsx b/src/redux/registrationFormSlice.jsx
index 5c9419b..bb20037 100644
--- a/src/redux/registrationFormSlice.jsx
+++ b/src/redux/registrationFormSlice.jsx
@@ -5,49 +5,72 @@ const registrationformSlice = createSlice({
initialState: {
personalDetails: {
name: "",
- mobileNumber: "",
+ mobile: "",
+ email: "",
gender: "",
- dob: "",
height: "",
weight: "",
- maritalStatus: "",
- religion: "",
- profileFor: "",
- caste: "",
- subCaste: "",
+ marital_status: "",
+ religion: 1, // Default Hindu
+ profile_for: "",
+ caste: 1, // Default Naidu
+ sub_caste: "",
+ willing_to_marry: "",
+ inter_caste_parents: "",
+ inter_caste_parents_details: "",
gothram: "",
- raasi: "",
- star: "",
- bloodGroup: "",
- email: "",
+ do_you_speak_telugu: "",
+ about_us: "",
+ known_languages: [],
+ mother_language: "",
+ complexion: "",
+ physical_status: "",
password: "",
confirmPassword: "",
+ dob: "",
+ raasi: "",
+ star: "",
state: "",
city: "",
pincode: "",
profiles: [],
+ verifiedMobileNumber: "",
},
educationalDetails: {
- collegeName: "",
- employeeType: "",
- qualification: "",
- fieldOfStudy: "",
+ study_field: "",
+ education: "",
+ education_detail: "",
+ college_name: "",
+ employee_type: "",
occupation: "",
- organization: "",
- income: "",
- workLocation: "",
+ occupation_detail: "",
+ company_name: "",
+ income_currency: "INR",
+ annual_income: "",
+ work_country: 1,
+ work_city: "",
+ work_state: "",
+ work_district: "",
+ address: "",
},
familyDetails: {
fatherName: "",
fatherOccupation: "",
motherName: "",
motherOccupation: "",
- brotherCount: 0,
- sisterCount: 0,
+ brotherCount: "",
+ sisterCount: "",
brothers: [],
sisters: [],
familyStatus: "",
nativePlace: "",
+ familyCountry: "",
+ familyState: "",
+ familyDistrict: "",
+ familyCity: "",
+ address: "",
+ expectationDetails: "",
+ willingToGoAbroad: "",
},
lifestyleDetails: {
diets: [],
@@ -114,14 +137,38 @@ const registrationformSlice = createSlice({
state.partnerPreferences = { ...state.partnerPreferences, ...action.payload };
},
- submitForm: (state) => {
- console.log("Form Submitted:", {
- personalDetails: state.personalDetails,
- educationalDetails: state.educationalDetails,
- familyDetails: state.familyDetails,
- lifestyleDetails: state.lifestyleDetails,
- partnerPreferences: state.partnerPreferences,
- });
+ clearAllStepsFrom: (state, action) => {
+ const step = action.payload;
+ if (step <= 2) {
+ state.educationalDetails = {
+ study_field: "", education: "", education_detail: "", college_name: "",
+ employee_type: "", occupation: "", occupation_detail: "", company_name: "",
+ income_currency: "INR", annual_income: "", work_country: "", work_state: "",
+ work_district: "", work_city: "", address: "",
+ };
+ }
+ if (step <= 3) {
+ state.familyDetails = {
+ fatherName: "", fatherOccupation: "", motherName: "", motherOccupation: "",
+ brotherCount: "", sisterCount: "", brothers: [], sisters: [],
+ familyStatus: "", nativePlace: "", familyCountry: "", familyState: "",
+ familyDistrict: "", familyCity: "", address: "", expectationDetails: "",
+ willingToGoAbroad: "",
+ };
+ }
+ if (step <= 4) {
+ state.lifestyleDetails = {
+ diets: "", hobbies: [], dob: "", tob: "", placeOfBirth: "",
+ graha: { 1: [], 2: [], 3: [], 4: [], 5: [], 6: [], 7: [], 8: [], 9: [], 10: [], 11: [], 12: [] },
+ amsam: { 1: [], 2: [], 3: [], 4: [], 5: [], 6: [], 7: [], 8: [], 9: [], 10: [], 11: [], 12: [] },
+ };
+ }
+ if (step <= 5) {
+ state.partnerPreferences = {
+ ageRange: "", castes: [], subCastes: [], occupations: [], educations: [],
+ hobbies: [], annualIncome: "", states: [], districts: [],
+ };
+ }
},
@@ -279,6 +326,7 @@ export const {
updateFamilyDetails,
updateLifestyleDetails,
updatePartnerPreferences,
+ clearAllStepsFrom,
submitForm,
preloadDummyProfile,
} = registrationformSlice.actions;
diff --git a/src/services/chatApi.js b/src/services/chatApi.js
new file mode 100644
index 0000000..3ad5878
--- /dev/null
+++ b/src/services/chatApi.js
@@ -0,0 +1,34 @@
+import axiosInstance from "../api/axiosInstance";
+import { API_ENDPOINTS } from "../api/apiEndpoints";
+
+export const getChatList = async (searchValue = "") => {
+ try {
+ // Add timestamp to prevent caching
+ const response = await axiosInstance.get(`${API_ENDPOINTS.CHAT_LIST}?search_value=${searchValue}&_t=${Date.now()}`);
+ return response.data;
+ } catch (error) {
+ console.error("Error fetching chat list:", error);
+ throw error;
+ }
+};
+
+export const getChatMessages = async (chatId, page = 1) => {
+ try {
+ const response = await axiosInstance.get(`${API_ENDPOINTS.CHAT_MESSAGES(chatId)}?page=${page}`);
+ return response.data;
+ } catch (error) {
+ console.error("Error fetching chat messages:", error);
+ throw error;
+ }
+};
+
+export const sendMessage = async (chatId, message) => {
+ try {
+ // Correct endpoint based on user request: chat/message/send?chat_id={id}&message={text}
+ const response = await axiosInstance.post(`chat/message/send?chat_id=${chatId}&message=${encodeURIComponent(message)}`);
+ return response.data;
+ } catch (error) {
+ console.error("Error sending message:", error);
+ throw error;
+ }
+};
diff --git a/src/services/profileActionApi.js b/src/services/profileActionApi.js
new file mode 100644
index 0000000..87c40ae
--- /dev/null
+++ b/src/services/profileActionApi.js
@@ -0,0 +1,65 @@
+import axiosInstance from "../api/axiosInstance";
+import { API_ENDPOINTS } from "../api/apiEndpoints";
+
+export const getBlockedProfiles = async () => {
+ try {
+ const response = await axiosInstance.get(API_ENDPOINTS.BLOCK_PROFILE_LIST);
+ return response.data;
+ } catch (error) {
+ console.error("Error fetching blocked profiles:", error);
+ throw error;
+ }
+};
+
+export const getReportedProfiles = async () => {
+ try {
+ const response = await axiosInstance.get(API_ENDPOINTS.REPORT_PROFILE_LIST);
+ return response.data;
+ } catch (error) {
+ console.error("Error fetching reported profiles:", error);
+ throw error;
+ }
+};
+
+export const unblockProfile = async (profileId) => {
+ try {
+ const response = await axiosInstance.post(`unblock_profile?profile_id=${profileId}`);
+ return response.data;
+ } catch (error) {
+ console.error("Error unblocking profile:", error);
+ throw error;
+ }
+};
+
+export const getProfileDetail = async (profile_id) => {
+ try {
+ const response = await axiosInstance.get(`${API_ENDPOINTS.PROFILE_DETAIL}?profile_id=${profile_id}`);
+ return response.data;
+ } catch (error) {
+ console.error("Error fetching profile detail:", error);
+ throw error;
+ }
+};
+
+export const getInterestList = async (tab, type) => {
+ try {
+ const response = await axiosInstance.get(`${API_ENDPOINTS.INTEREST_LIST}?tab=${tab}&type=${type}`);
+ return response.data;
+ } catch (error) {
+ console.error("Error fetching interest list:", error);
+ throw error;
+ }
+};
+
+export const updateInterestStatus = async (profile_id, status) => {
+ try {
+ const response = await axiosInstance.post(API_ENDPOINTS.UPDATE_INTEREST_STATUS, {
+ profile_id,
+ status
+ });
+ return response.data;
+ } catch (error) {
+ console.error("Error updating interest status:", error);
+ throw error;
+ }
+};
diff --git a/src/services/shortlistapi.js b/src/services/shortlistapi.js
index a97c931..5351bc1 100644
--- a/src/services/shortlistapi.js
+++ b/src/services/shortlistapi.js
@@ -10,7 +10,9 @@ export const shortlistProfile = async (profileId) => {
};
export const sendInterest = async (profileId) => {
- const response = await axiosInstance.post(`interest?profile_id=${profileId}`);
+ const response = await axiosInstance.post(`interest_send`, {
+ profile_id: profileId // ✅ sent in request body
+ });
if (response.data?.status === "error") {
throw new Error(response.data.message || "Failed to send interest");
}