import axios from 'axios';

export async function setRectificative(route) {
    const card = route.matched.find((route) => route.name === 'InvoiceInCard');
    const corrective = card.children.find(
        (route) => route.name === 'InvoiceInCorrective'
    );

    corrective.meta.hidden = !(
        await axios.get('InvoiceInCorrections', {
            params: { filter: { where: { correctingFk: route.params.id } } },
        })
    ).data.length;
}
