fixed getSaleProperiesById and make login type is email
All checks were successful
Build frontend / build (push) Successful in 1m46s
All checks were successful
Build frontend / build (push) Successful in 1m46s
This commit is contained in:
@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user