fixed getSaleProperiesById and make login type is email
All checks were successful
Build frontend / build (push) Successful in 1m46s

This commit is contained in:
hamzaobed7
2026-08-11 16:04:09 +03:00
parent 4924e7c2f3
commit 00dde588cb
10 changed files with 421 additions and 394 deletions

View File

@ -5,7 +5,7 @@ import { useTranslation } from "react-i18next";
import { motion, AnimatePresence } from "framer-motion";
import toast, { Toaster } from "react-hot-toast";
import Link from "next/link";
import { useParams, useRouter } from "next/navigation";
import { useParams, useRouter, useSearchParams } from "next/navigation";
import {
MapPin,
Bed,
@ -244,9 +244,10 @@ function mapApiDetail(item) {
};
}
export default function PropertyDetailsPage() {
export default function PropertyDetailsPage({type}) {
const { t, i18n } = useTranslation();
const params = useParams();
const router = useRouter();
const { isFavorite, addFavorite, removeFavorite } = useFavorites();
@ -271,6 +272,7 @@ export default function PropertyDetailsPage() {
useEffect(() => {
const id = params.id;
if (!id) return;
setLoading(true);
@ -278,7 +280,7 @@ export default function PropertyDetailsPage() {
try {
let data = null;
try {
data = await getRentProperty(id);
data = type==="rent"?await getRentProperty(id):(await getSalePropertyById(id)) || (await getSaleProperty(id));
} catch {}
if (!data) {
try {