import { API_URL, TOKEN } from "@/utils/constants/selectConstants";

export async function getEspecialidadesCredenciadosVeterinarios(params: any) {

    try {
        let url = ''
        if(params){
            url = `Especialidades/ConsultarListaEspecialidades?order=Nome ASC`;
        }

        const response = await fetch(`${API_URL}${url}`, {
            headers: {
                Authorization: TOKEN
            }
        })

        if (!response.ok) {
            return { erro: true };
        }

        return response.json();

    } catch {
        console.log('Erro ao consultar cidades.')
        return { erro: true };
    }

}