Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

featuredProductsRequest.js 338B

123456789101112131415
  1. import apiEndpoints from '../apiEndpoints';
  2. export const getFeaturedProducts = async () => {
  3. const response = await fetch(
  4. `http://localhost:3000${apiEndpoints.featuredProducts}`
  5. );
  6. const data = await response.json();
  7. if (!response.ok) {
  8. throw new Error(data.message || 'Something went wrong!');
  9. }
  10. return data;
  11. };