import { useFetch } from '@win2win/shared-ui';
import { Importacion } from 'src/pages/proveedores/models';
import { computed } from 'vue';

export function useImportacionesSolicitud() {
  const queryKey = computed(() => ['importaciones']);
  const path = computed(() => `w2w-query/importaciones(tipo='solicitud')->imp_layout(id=importaciones.id_layout,estado='1')`);
  const { data: importaciones, fetching } = useFetch<Importacion[]>(queryKey, path, {
    importaciones: ['id', 'nombre', 'tipo'],
    imp_layout: ['id', 'estructura', 'version'],
  });
  return { importaciones, fetching };
}
