Forum

Ask, reply and learn. Join the community of Akaunting.

New Discussion

500 Error when adding Invoice by API

Henry Nanne   ( User )

Commented 5 years ago

I was able to update. In the folder app/http/requests/common/company (I think that with the others models, is the same change), change:


//use Illuminate\Foundation\Http\FormRequest;


use Dingo\Api\Http\FormRequest;


 


However, I think that it will be a problem, because I change core files, so, not should be considerate a complete solution, with the next update, that file could be replaced. The problem still there.


 

Kalpesh   ( User )

Commented 5 years ago

Hi Jerry, did you find the solution for this? Do let me know, if you have. Thank you.

Jerry   ( User )

Commented 5 years ago

Hi Kalpesh, I did not fix it.


So if anyone has, please let me know too!

Henk Jan Tempelaar   ( User )

Commented 3 years ago

Same issue here. Looks like the create returns a view instead of a JSON string. Looking at the code I see:
public function store(Request $request)
{
$invoice = $this->dispatch(new CreateInvoice($request));

return $this->response->created(route('api.invoices.show', $invoice->id));
}

I changed the return to the same as the show function
return $this->response->item($invoice, new Transformer());

and then it works

Please login or register to leave a response.

Showing 11 to 14 of 14 discussions