Forum

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

New Discussion

[PUT] api/contacts/1?customer_id=1

Wong Jun Wang   ( User )

Commented 4 years ago

/**
* Update the specified resource in storage.
*
* @param $contact
* @param $request
* @return \Dingo\Api\Http\Response
*/
public function update(Contact $contact, Request $request)
{
$contact = $this->dispatch(new UpdateContact($contact, $request));

return $this->item($contact->fresh(), new Transformer());
}

respond this error
+"message": "No query results for model [App\Models\Common\Contact] 1"
+"status_code": 404

i bet is error on Contact $contact, but no ideal what it should be? do this update api still working?

Wong Jun Wang   ( User )

Commented 4 years ago

*[PUT] api/contacts/1?company_id=1
typo on title.

Wong Jun Wang   ( User )

Commented 4 years ago

found that apicompany middleware not being called, may i know where to include it? found no where.

Wong Jun Wang   ( User )

Commented 4 years ago

is this causing error $this->$type->getAttribute('id'); when PATCH execute

Wong Jun Wang   ( User )

Commented 4 years ago

Finally i modify some of the code to make it update successful. Hope there will be any respond from you guys.

Denis Dulici   ( Admin )

Commented 4 years ago

Have you tried PATCH instead of PUT?

Please login or register to leave a response.

Showing 1 to 6 of 6 discussions