ProductStore, move API calls to separate file
This commit is contained in:
10
software/src/data/api/productApi.ts
Normal file
10
software/src/data/api/productApi.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
import axios from "axios"
|
||||
|
||||
let BASE_URL = "http://localhost:3000/products"
|
||||
|
||||
/**
|
||||
* Fetch all products from API
|
||||
*/
|
||||
export async function getAllProducts() {
|
||||
return await axios.get(BASE_URL)
|
||||
}
|
||||
Reference in New Issue
Block a user