Solucionado (ver solução)
Solucionado
(ver solução)
1
resposta

\n\nSQLSTATE[23000]: Integrity constraint violation: 1048 Column 'slug' cannot be null" - COMO POSSO RESULVER ESSE ERRO DA API PARA O PUT RETORNAR APENAS UM JSON ?

"errors": [ { "code": 0, "message":"There was a problem saving the product: An exception occurred while executing 'INSERT INTO Product (name, slug, referenceCode, obligate_subscription, available_for, mva_original, ipi, available_on, stock_control, created_at, updated_at, deleted_at, views, ncm, integration_code, tax_reduction_for, product_type_id, product_status_id, last_product_status_history_id, shopping_store_id, distribution_center_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)' with params ["Teste lista pre\ço", null, "teste-lista-preco654654", null, 1, null, null, "2021-07-30 12:20:04", 0, "2021-07-30 12:20:04", "2021-07-30 12:20:04", null, 0, null, null, null, 1, 1, null, null, 1]:\n\nSQLSTATE[23000]: Integrity constraint violation: 1048 Column 'slug' cannot be null" } ] }

1 resposta
solução!

Olá Gustavo, tudo bem?

Analisando o log, percebi que ele aponta na coluna 'slug' dizendo que ela não pode ser null.

Para resolver isso vc pode passar algum valor nessa coluna ou alterar o tipo dela de not null para null.

Espero ter ajudado! Um abraço e bons estudos!!! :-)

Quer mergulhar em tecnologia e aprendizagem?

Receba a newsletter que o nosso CEO escreve pessoalmente, com insights do mercado de trabalho, ciência e desenvolvimento de software