feat: Add Docker support and improve API structure

- Introduced Dockerfile and .dockerignore for containerization.
- Removed unused API route `src/app/api/hello/route.ts`.
- Added new API route for fetching products by category.
- Enhanced existing product category API to include descriptions.
- Updated product categories data structure to include descriptions.
- Improved product fetching logic in the product categories page.
- Refactored breadcrumb component for better navigation.
- Added new AchievementIconWhite component for UI consistency.
- Updated Navbar to use routeFactory for better maintainability.
- Enhanced styling in various components for improved responsiveness.
- Removed obsolete language switcher component.
This commit is contained in:
2025-06-05 16:03:59 +03:30
parent d44aa203e0
commit 0bd5060580
28 changed files with 403 additions and 111 deletions
+14 -1
View File
@@ -1,3 +1,5 @@
import type { IProductCategoryCardProps } from '@/components/pages/productCategories/productCategoryCard.d';
import type { IProductCardProps } from '@/components/pages/products/productCard.d';
import api from '@/lib/axios';
export function getProductCategories() {
@@ -9,7 +11,9 @@ export function getProductCategories() {
.catch((error) => Promise.reject(error));
}
export function getProductCategoryById(categoryId: string) {
export function getProductCategoryById(
categoryId: string,
): Promise<IProductCategoryCardProps> {
return api
.get(`/product_categories/${categoryId}`)
.then(({ data }) => {
@@ -17,3 +21,12 @@ export function getProductCategoryById(categoryId: string) {
})
.catch((error) => Promise.reject(error));
}
export function getProducts(categoryId: string): Promise<IProductCardProps[]> {
return api
.get(`/product_categories/${categoryId}/products`)
.then(({ data }) => {
return Promise.resolve(data.data);
})
.catch((error) => Promise.reject(error));
}