Int_Prog/лаб3/lab3/public/scripts/api/fetchProductById.js
2024-01-19 01:24:45 +04:00

6 lines
186 B
JavaScript

import { serverPath } from "../variables.js";
export async function fetchProductById(id) {
const response = await fetch(`${serverPath}/products?id=${id}`);
return response.json();
}