feat(): Added ci restruct project and add dockerfile
This commit is contained in:
1 parent
5451970f02
commit
8aa8e04077
70 files changed
+81
-11
No files matched your search
@@ -0,0 +1,14 @@
|
||||
import axios from "axios";
|
||||
import type { Product } from "../types/product";
|
||||
import type { Category } from "../types/categories";
|
||||
|
||||
export const fetchCategoryProducts = async (category: string): Promise<Product[]> => {
|
||||
const response = await axios.get(`https://your-api.com/api/products?category=${category}`);
|
||||
return response.data;
|
||||
};
|
||||
|
||||
export const fetchCategories = async (categoryid: string): Promise<Category[]> => {
|
||||
const response = await axios.get(`https://your-api.com/api/category=${categoryid}`);
|
||||
return response.data;
|
||||
};
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
import axios from "axios";
|
||||
|
||||
export const API_BASE = "";
|
||||
const client = axios.create({
|
||||
baseURL: API_BASE,
|
||||
headers: { "Content-Type": "application/json" },
|
||||
});
|
||||
|
||||
export default client;
|
||||
Reference in new issue
Block a user