Skip to content

Commit

Permalink
products sabsabcat
Browse files Browse the repository at this point in the history
  • Loading branch information
Aayaninfotech authored and Aayaninfotech committed Dec 23, 2024
1 parent 55b6138 commit 483aa31
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/views/Product_Management/AddProduct.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,19 @@ const AddProductForm = () => {
// Fetch data for categories, subcategories, and subsubcategories
useEffect(() => {
// Fetch categories
fetch('http://localhost:7878/api/categories')
fetch('http://44.196.64.110:7878/api/categories')
.then((response) => response.json())
.then((data) => setCategories(data))
.catch((error) => console.error('Error fetching categories:', error));

// Fetch subcategories
fetch('http://localhost:7878/api/subcategory')
fetch('http://44.196.64.110:7878/api/subcategory')
.then((response) => response.json())
.then((data) => setSubCategories(data))
.catch((error) => console.error('Error fetching subcategories:', error));

// Fetch subsubcategories
fetch('http://localhost:7878/api/subSubCategories')
fetch('http://44.196.64.110:7878/api/subSubCategories')
.then((response) => response.json())
.then((data) => setSubSubCategories(data))
.catch((error) => console.error('Error fetching subsubcategories:', error));
Expand All @@ -44,7 +44,7 @@ const AddProductForm = () => {
setProductData({ ...productData, category: selectedCategory, subCategory: '', subSubCategory: '' });

// Fetch subcategories based on selected category
fetch(`http://localhost:7878/api/subcategory?category=${selectedCategory}`)
fetch(`http://44.196.64.110:7878/api/subcategory?category=${selectedCategory}`)
.then((response) => response.json())
.then((data) => setSubCategories(data))
.catch((error) => console.error('Error fetching subcategories for category:', error));
Expand All @@ -56,7 +56,7 @@ const AddProductForm = () => {
setProductData({ ...productData, subCategory: selectedSubCategory, subSubCategory: '' });

// Fetch subsubcategories based on selected subcategory
fetch(`http://localhost:7878/api/subSubCategories?subcategory=${selectedSubCategory}`)
fetch(`http://44.196.64.110:7878/api/subSubCategories?subcategory=${selectedSubCategory}`)
.then((response) => response.json())
.then((data) => setSubSubCategories(data))
.catch((error) => console.error('Error fetching subsubcategories for subcategory:', error));
Expand Down

0 comments on commit 483aa31

Please sign in to comment.