Browse Source

API connected , Staticks changed

main
sina_sajjadi 2 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) {
console.log(response);
user.avatar = response.data.avatar;
user.email = response.data.email;
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}`
}
})
console.log(response);
setShow(false)
}catch (error){

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

@ -20,15 +20,11 @@ useEffect(()=>{
})
.then((response)=>{
setPassenger(response.data.results);
console.log(response);
}).catch((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"))
User? setStatus(true) : setStatus(false)
console.log(status);
console.log(User.avatar);
return (
<div className={`nc-MainNav1 relative z-10 ${className}`}>
<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)
} , [])
console.log(passengers);
return (
<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]);
}
console.log(newPassenger);
console.log(passengers);
const index = Number(params.stepIndex) || 1;
const nextHref = (
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");
} catch (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)) {
setForm(form);
console.log('Form is valid, submitting:', form);
await axiosInstance
.get(`/api/account/verfication/?range_phone=${countryCode}&phone_number=${phoneNumber}`)
.then((response) => {
setMethod(response.data.verification_method)
console.log(response.data.verification_method);
})
.catch((error) => {
console.error("Error fetching data:", error);

2
src/app/login/page.tsx

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

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

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

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

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

1
src/components/CardCategory3.tsx

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

1
src/components/SectionCustomTour.tsx

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

7
src/components/SectionGridFeaturePlaces.tsx

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

2
src/components/SectionSliderNewCategories.tsx

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

2
src/components/StayCard2.tsx

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

5
src/components/api/axios.tsx

@ -6,22 +6,17 @@ const axiosInstance= axios.create({
axiosInstance.interceptors.request.use(
(config) => {
// Log the request headers
console.log('Request Headers:', config);
return config;
},
(error) => {
// Handle the request error
console.error('Request Error:', error);
return Promise.reject(error);
}
);
// You can also add a response interceptor if needed
axiosInstance.interceptors.response.use(
(response) => response,
(error) => {
// Handle response errors
console.error('Response Error:', 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) => {
await axiosInstance
@ -43,7 +42,6 @@ export const ContextProvider = ({ children }) => {
.catch((error) => {
console.error("Error fetching data:", error);
});
// console.log(details);
// await axiosInstance
// .get(`/api/tours/${item}/passengers/`)
// .then((response) => {
@ -52,7 +50,6 @@ export const ContextProvider = ({ children }) => {
// .catch((error) => {
// console.error("Error fetching data:", error);
// });
// console.log(passengers);
};
return (

Loading…
Cancel
Save