{"size": 1303, "ext": "js", "max_stars_repo_path": "src/views/base/cliente/ClienteFormInsert.js", "max_stars_repo_name": "sebastianaf/cme-coreui", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/views/base/cliente/ClienteFormInsert.js", "max_issues_repo_name": "sebastianaf/cme-coreui", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/views/base/cliente/ClienteFormInsert.js", "max_forks_repo_name": "sebastianaf/cme-coreui", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 29.6136363636, "max_line_length": 60, "alphanum_fraction": 0.4635456639}
import { insertControlIngreso } from './ControlIngresoFetch'

const insertControlRegistro = async (data,props) => {
    try {
        const out = await insertControlIngreso(data)
        if (!out.error) {
            props.addToast({
                header: "Aviso",
                body: `Ingreso registrado correctamente`,
                color: "success",
                position: "top-right",
                autohide: true,
                autohideValue: 2000,
                closeButton: true,
                fade: true
            })
            props.setModal(false)
        } else {
            props.addToast({
                header: "Error",
                body: `Error registrando el ingreso`,
                color: "danger",
                position: "top-right",
                autohide: true,
                autohideValue: 2000,
                closeButton: true,
                fade: true
            })
        }
    } catch (error) {
        props.addToast({
            header: "Error",
            body: `Ha ocurrido un error en el registro`,
            color: "danger",
            position: "top-right",
            autohide: true,
            autohideValue: 2000,
            closeButton: true,
            fade: true
        })
    }
}

export { insertControlRegistro }