Next.js template
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

dataIdsRequest.js 311B

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