Bayut

फ्रीमियम
Verified
द्वारा Api Dojo | अपडेट किया गया 24 days ago | Business
लोकप्रियता

9.8 / 10

लेटेंसी

2,142ms

सेवा का स्तर

100%

Health Check

N/A

सभी चर्चाओं पर वापस जाएं

Getting undefined after call.

Rapid account: Davidfranjul 09
davidfranjul09
a year ago

Server Error
TypeError: Cannot read properties of undefined (reading ‘map’)

This error happened while generating the page. Any console logs will be displayed in the terminal window.

export async function getServerSideProps(context) {
const { id } = context.query;
const property = await getProperty(id);

return { props: { property: property } };
}

import { axios } from “@/lib/axios”;

export const getProperties = async (num) => {
const { data } = await axios.get("/properties/list", {
params: {
locationExternalIDs: “5002,6020”,
purpose: “for-sale”,
hitsPerPage: num,
lang: “en”,
sort: “city-level-score”,
hasVideo: true,
hasFloorPlan: true,
hasPanorama: true,
},
});
return data.hits;
};

import { axios } from “@/lib/axios”;

export const getProperty = async (id) => {
const { data } = await axios.get("/properties/detail", {
params: { externalID: id },
});
return data;
};

Rapid account: Apidojo
apidojo Commented a year ago

Hello,

I am sorry that I cannot help you with coding.
You can test the endpoint by using an HTTP client such as postman.com to see whether or not it works.

Regards.

चर्चा में शामिल हों - नीचे टिप्पणी जोड़ें:

नई टिप्पणियाँ पोस्ट करने के लिए लॉग इन / साइनअप करें