Browse Source

API connected , Staticks changed

main
sina_sajjadi 3 months ago
parent
commit
30f8776601
  1. 2
      src/app/(account-pages)/account/page.tsx
  2. 2
      src/app/(account-pages)/passengers-list/PassengerTable.tsx
  3. 4
      src/app/(account-pages)/passengers-list/page.tsx
  4. 7
      src/app/(client-components)/(Header)/MainNav1.tsx
  5. 1
      src/app/(client-components)/(HeroSearchForm)/GuestsInput.tsx
  6. 3
      src/app/add-listing/[[...stepIndex]]/page.tsx
  7. 1
      src/app/add-new-passenger/page.tsx
  8. 2
      src/app/forgot-password/page.tsx
  9. 2
      src/app/login/page.tsx
  10. 4
      src/app/signup/methodes/page.tsx
  11. 3
      src/app/tours/[slug]/page.tsx
  12. 1
      src/components/CardCategory3.tsx
  13. 1
      src/components/SectionCustomTour.tsx
  14. 7
      src/components/SectionGridFeaturePlaces.tsx
  15. 2
      src/components/SectionSliderNewCategories.tsx
  16. 2
      src/components/StayCard2.tsx
  17. 5
      src/components/api/axios.tsx
  18. 3
      src/components/contexts/tourDetails.tsx

2
src/app/(account-pages)/account/page.tsx

@ -83,8 +83,6 @@ const AccountPage = () => {
} }
); );
if (response.status === 200) { if (response.status === 200) {
console.log(response);
user.avatar = response.data.avatar; user.avatar = response.data.avatar;
user.email = response.data.email; user.email = response.data.email;
user.fullname = response.data.fullname; user.fullname = response.data.fullname;

2
src/app/(account-pages)/passengers-list/PassengerTable.tsx

@ -15,8 +15,6 @@ const [show , setShow] =useState(true)
Authorization : `token ${user.token}` Authorization : `token ${user.token}`
} }
}) })
console.log(response);
setShow(false) setShow(false)
}catch (error){ }catch (error){

4
src/app/(account-pages)/passengers-list/page.tsx

@ -20,15 +20,11 @@ useEffect(()=>{
}) })
.then((response)=>{ .then((response)=>{
setPassenger(response.data.results); setPassenger(response.data.results);
console.log(response);
}).catch((error)=>{ }).catch((error)=>{
console.error(error); console.error(error);
}) })
console.log(passengers);
} , []) } , [])

7
src/app/(client-components)/(Header)/MainNav1.tsx

@ -20,13 +20,6 @@ const MainNav1: FC<MainNav1Props> = ({ className = "" }) => {
const User = JSON.parse(localStorage.getItem("user")) const User = JSON.parse(localStorage.getItem("user"))
User? setStatus(true) : setStatus(false) User? setStatus(true) : setStatus(false)
console.log(status);
console.log(User.avatar);
return ( return (
<div className={`nc-MainNav1 relative z-10 ${className}`}> <div className={`nc-MainNav1 relative z-10 ${className}`}>
<div className="px-4 lg:container h-20 relative flex justify-between"> <div className="px-4 lg:container h-20 relative flex justify-between">

1
src/app/(client-components)/(HeroSearchForm)/GuestsInput.tsx

@ -42,7 +42,6 @@ const GuestsInput: FC<GuestsInputProps> = ({
setPassengers(guestAdultsInputValue) setPassengers(guestAdultsInputValue)
} , []) } , [])
console.log(passengers);
return ( return (
<Popover className={`flex relative ${className}`}> <Popover className={`flex relative ${className}`}>

3
src/app/add-listing/[[...stepIndex]]/page.tsx

@ -30,9 +30,6 @@ const CommonLayout: FC<CommonLayoutProps> = ({ params }) => {
setPassengers((prev) => [...prev, newPassenger]); setPassengers((prev) => [...prev, newPassenger]);
} }
console.log(newPassenger);
console.log(passengers);
const index = Number(params.stepIndex) || 1; const index = Number(params.stepIndex) || 1;
const nextHref = ( const nextHref = (
index < 10 ? `/add-listing/${index + 1}` : `/add-listing/${1}` index < 10 ? `/add-listing/${index + 1}` : `/add-listing/${1}`

1
src/app/add-new-passenger/page.tsx

@ -108,7 +108,6 @@ const CommonLayout: FC<CommonLayoutProps> = () => {
} }
); );
console.log(response.data);
router.push("/passengers-list"); router.push("/passengers-list");
} catch (error) { } catch (error) {
console.error("Error saving passenger:", error); console.error("Error saving passenger:", error);

2
src/app/forgot-password/page.tsx

@ -52,12 +52,10 @@ const PageSignUp: FC<PageSignUpProps> = ({}) => {
if (validateForm(form)) { if (validateForm(form)) {
setForm(form); setForm(form);
console.log('Form is valid, submitting:', form);
await axiosInstance await axiosInstance
.get(`/api/account/verfication/?range_phone=${countryCode}&phone_number=${phoneNumber}`) .get(`/api/account/verfication/?range_phone=${countryCode}&phone_number=${phoneNumber}`)
.then((response) => { .then((response) => {
setMethod(response.data.verification_method) setMethod(response.data.verification_method)
console.log(response.data.verification_method);
}) })
.catch((error) => { .catch((error) => {
console.error("Error fetching data:", error); console.error("Error fetching data:", error);

2
src/app/login/page.tsx

@ -43,12 +43,10 @@ const PageLogin: FC<PageLoginProps> = ({}) => {
password, password,
}) })
.then((response) => { .then((response) => {
console.log(response);
if (response.status === 201) { if (response.status === 201) {
localStorage.setItem("user", JSON.stringify(response.data)); localStorage.setItem("user", JSON.stringify(response.data));
setStatus(true) setStatus(true)
console.log(response.data);
} else { } else {

4
src/app/signup/methodes/page.tsx

@ -35,7 +35,6 @@ function SelectMethods() {
setSelectedMethod(e.target.value); setSelectedMethod(e.target.value);
} }
}; };
console.log(method);
const handleSubmit = async () => { const handleSubmit = async () => {
setLoading(true); setLoading(true);
@ -56,9 +55,8 @@ function SelectMethods() {
}, },
} }
); );
console.log(response);
response.status === 202 && response.status === 202 &&
(console.log("sucsses"),
(
setLoading(false), setLoading(false),
router.replace("signup/otp-code")); router.replace("signup/otp-code"));
} catch (error) { } catch (error) {

3
src/app/tours/[slug]/page.tsx

@ -35,7 +35,6 @@ const ListingStayDetailPage: FC<ListingStayDetailPageProps> = ({}) => {
getTourData(id); getTourData(id);
}, []); }, []);
console.log(details);
let [isOpenModalAmenities, setIsOpenModalAmenities] = useState(false); let [isOpenModalAmenities, setIsOpenModalAmenities] = useState(false);
@ -166,7 +165,6 @@ const ListingStayDetailPage: FC<ListingStayDetailPageProps> = ({}) => {
))} ))}
</div> </div>
{console.log(details)}
<div className="w-14 border-b border-neutral-200"></div> <div className="w-14 border-b border-neutral-200"></div>
<div> <div>
<ButtonSecondary onClick={openModalAmenities}> <ButtonSecondary onClick={openModalAmenities}>
@ -599,7 +597,6 @@ const ListingStayDetailPage: FC<ListingStayDetailPageProps> = ({}) => {
alt="" alt=""
sizes="400px" sizes="400px"
/> />
{console.log(details)}
</div> </div>
{/* OVERLAY */} {/* OVERLAY */}

1
src/components/CardCategory3.tsx

@ -16,7 +16,6 @@ const CardCategory3: FC<CardCategory3Props> = ({
}) => { }) => {
const { count, name, href = "/", thumbnail } = taxonomy; const { count, name, href = "/", thumbnail } = taxonomy;
console.log(taxonomy.city[0].thumbnail);
return ( return (
<Link href={href} className={`nc-CardCategory3 flex flex-col ${className}`}> <Link href={href} className={`nc-CardCategory3 flex flex-col ${className}`}>

1
src/components/SectionCustomTour.tsx

@ -9,7 +9,6 @@ export interface SectionCustomTourProps {
rightImg?: StaticImageData; rightImg?: StaticImageData;
type?: "type1" | "type2"; type?: "type1" | "type2";
} }
console.log("fsafs");
const SectionCustomTour: FC<SectionCustomTourProps> = ({ const SectionCustomTour: FC<SectionCustomTourProps> = ({
className = "lg:py-14", className = "lg:py-14",

7
src/components/SectionGridFeaturePlaces.tsx

@ -35,14 +35,12 @@ const SectionGridFeaturePlaces: FC<SectionGridFeaturePlacesProps> = ({
const { countries, tours } = useContext(Context); const { countries, tours } = useContext(Context);
const [countryTours, setCountryTours] = useState(); const [countryTours, setCountryTours] = useState();
console.log(tours);
useEffect(()=>{ useEffect(()=>{
handleChange("All") handleChange("All")
} , [tours , countries]) } , [tours , countries])
const handleChange = async (item) => { const handleChange = async (item) => {
console.log(item , countries , tours);
if (item ==="All"){ if (item ==="All"){
setCountryTours(tours.results); setCountryTours(tours.results);
@ -52,11 +50,8 @@ const SectionGridFeaturePlaces: FC<SectionGridFeaturePlacesProps> = ({
(tour) => tour.destination_country === selected?.code (tour) => tour.destination_country === selected?.code
); );
setCountryTours(selectedTours); setCountryTours(selectedTours);
console.log(selected);
console.log(selectedTours);}
}
}; };
console.log(countries);
// const renderCard = (stay: StayDataType) => { // const renderCard = (stay: StayDataType) => {
// let CardName = StayCard; // let CardName = StayCard;
// switch (cardType) { // switch (cardType) {

2
src/components/SectionSliderNewCategories.tsx

@ -115,7 +115,6 @@ const SectionSliderNewCategories: FC<SectionSliderNewCategoriesProps> = ({
const [direction, setDirection] = useState(0); const [direction, setDirection] = useState(0);
const [numberOfItems, setNumberOfitem] = useState(0); const [numberOfItems, setNumberOfitem] = useState(0);
const { countries} = useContext(Context); const { countries} = useContext(Context);
console.log(countries)
const windowWidth = useWindowSize().width; const windowWidth = useWindowSize().width;
@ -148,7 +147,6 @@ const SectionSliderNewCategories: FC<SectionSliderNewCategoriesProps> = ({
// }); // });
// }, []); // }, []);
// console.log(tours);
function changeItemId(newVal: number) { function changeItemId(newVal: number) {
if (newVal > currentIndex) { if (newVal > currentIndex) {

2
src/components/StayCard2.tsx

@ -40,7 +40,6 @@ const StayCard2: FC<StayCard2Props> = ({
} = data; } = data;
const renderSliderGallery = () => { const renderSliderGallery = () => {
// console.log(data);
return ( return (
<> <>
@ -64,7 +63,6 @@ const StayCard2: FC<StayCard2Props> = ({
</> </>
); );
}; };
console.log(data);
const renderContent = () => { const renderContent = () => {
return ( return (

5
src/components/api/axios.tsx

@ -6,22 +6,17 @@ const axiosInstance= axios.create({
axiosInstance.interceptors.request.use( axiosInstance.interceptors.request.use(
(config) => { (config) => {
// Log the request headers
console.log('Request Headers:', config);
return config; return config;
}, },
(error) => { (error) => {
// Handle the request error
console.error('Request Error:', error); console.error('Request Error:', error);
return Promise.reject(error); return Promise.reject(error);
} }
); );
// You can also add a response interceptor if needed
axiosInstance.interceptors.response.use( axiosInstance.interceptors.response.use(
(response) => response, (response) => response,
(error) => { (error) => {
// Handle response errors
console.error('Response Error:', error); console.error('Response Error:', error);
return Promise.reject(error); return Promise.reject(error);
} }

3
src/components/contexts/tourDetails.tsx

@ -32,7 +32,6 @@ export const ContextProvider = ({ children }) => {
}); });
}, []); }, []);
console.log(tours);
const getTourData = async (item) => { const getTourData = async (item) => {
await axiosInstance await axiosInstance
@ -43,7 +42,6 @@ export const ContextProvider = ({ children }) => {
.catch((error) => { .catch((error) => {
console.error("Error fetching data:", error); console.error("Error fetching data:", error);
}); });
// console.log(details);
// await axiosInstance // await axiosInstance
// .get(`/api/tours/${item}/passengers/`) // .get(`/api/tours/${item}/passengers/`)
// .then((response) => { // .then((response) => {
@ -52,7 +50,6 @@ export const ContextProvider = ({ children }) => {
// .catch((error) => { // .catch((error) => {
// console.error("Error fetching data:", error); // console.error("Error fetching data:", error);
// }); // });
// console.log(passengers);
}; };
return ( return (

Loading…
Cancel
Save