import PocketBase from 'pocketbase';

export const getFaults = async () => {
  const pb = new PocketBase(import.meta.env.VITE_BASE_URL_API);
  const collection = 'averias';

  try {
    const data = await pb.collection(collection).getList();

    return data;
  } catch (error) {
    console.error(error);
    return [];
  }
};
