umarley / seteAPI

BSD 3-Clause "New" or "Revised" License
2 stars 0 forks source link

Erro CORS na hora de enviar CENSO via Web #89

Open marcosroriz opened 2 years ago

marcosroriz commented 2 years ago

Access to XMLHttpRequest at 'https://sete.transportesufg.eng.br/censo/5201405' from origin 'https://sete-web.transportesufg.eng.br' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

Possível erro no servidor: SQLSTATE[23505]: Unique violation: 7 ERROR: duplicate key value violates unique constraint "sete_alunos_pkey" DETAIL: Key (id_aluno, codigo_cidade)=(559, 5201405) already exists.

Requisição: POST censo/5201405

Payload:

{
    "alunos": [
        {
            "id_escola": 22140239,
            "nome": "MARIANA CECILIA BARBOSA DA SILVA",
            "data_nascimento": "02/07/2015",
            "nome_responsavel": "ANTONIA RODRIGUES DA SILVA BARBOSA",
            "sexo": 2,
            "cor": 3,
            "mec_tp_localizacao": 2,
            "turno": 2,
            "nivel": 1,
            "def_caminhar": "N",
            "def_ouvir": "N",
            "def_enxergar": "N",
            "def_mental": "N",
            "mec_id_inep": "177799973160",
            "loc_cep": "64430000"
        },
        {
            "id_escola": 22140239,
            "nome": "RAYNAN FERNANDO LEAL EDUARDO",
            "data_nascimento": "13/12/2017",
            "nome_responsavel": "RAISA LOHANE DE ANDRADE LEAL",
            "sexo": 1,
            "cor": 3,
            "mec_tp_localizacao": 2,
            "turno": 2,
            "nivel": 1,
            "def_caminhar": "N",
            "def_ouvir": "N",
            "def_enxergar": "N",
            "def_mental": "N",
            "mec_id_inep": "185323778155",
            "loc_cep": "64430000",
            "cpf": "10885875346"
        }
    ],
    "escolas": [
        {
            "contato_responsavel": "LUCILENE GOMES DA SILVA",
            "contato_telefone": "",
            "mec_in_regular": "S",
            "mec_in_eja": "N",
            "mec_in_profissionalizante": "N",
            "mec_in_especial_exclusiva": "N",
            "horario_matutino": "S",
            "horario_vespertino": "S",
            "horario_noturno": "N",
            "ensino_pre_escola": "S",
            "ensino_fundamental": "N",
            "ensino_medio": "N",
            "ensino_superior": "N",
            "id_escola": 22140239,
            "mec_co_entidade": 22140239,
            "nome": "CENTRO DE ENS INF PROFESSORA OSVALDINA DE S LIMA",
            "mec_no_entidade": "CENTRO DE ENS INF PROFESSORA OSVALDINA DE S LIMA",
            "loc_cep": "64430000",
            "mec_co_municipio": "5201405",
            "loc_endereco": "RUA OSVALDO CRUZ - NUM SN - BAIRRO: MUTIRAO",
            "mec_tp_localizacao": 1,
            "mec_tp_localizacao_diferenciada": 7,
            "mec_tp_dependencia": 3,
            "contato_email": "lucilenegomes22@hotmail.com",
            "mec_co_uf": 22
        }
    ]
}