Forum

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

New Discussion

DELETE method not working

Lennart Behr   ( User )

Commented 4 years ago

Hello there,

I know I've been spamming the forum lately, but this issue really bothers me and was present in version 1.3 already and is still present in version 2.0.2.
I can't delete customers (or now contacts of type "customer") using the REST API.

The api route under /routes/api.php describes the following:
$api->resource('contacts', 'Common\Contacts');

So requesting /api/contacts using GET returns all registered contacts.
When I now call DELETE @ /api/contacts/{contact_id}?company_id={company_id}
I'm facing a 404 response:

{
"message": "No query results for model [App\\Models\\Common\\Contact] 2",
"status_code": 404,
"debug": { … }
}

So please, @Admin, @Developers, what am I doing wrong??

Regards,
L. Behr

Denis Dulici   ( Admin )

Commented 4 years ago

Hello Lennart,

Are you able to GET that contact?

Regards

Lennart Behr   ( User )

Commented 4 years ago

I am indeed able to GET that contact, it returns:
{
"data": {
"id": 2,
"company_id": 1,
"user_id": 33,
"type": "customer", ...
}
}

DELETE however does not work.

Lennart Behr   ( User )

Commented 4 years ago

GET request was:
GET @ /api/contacts/2?company_id=1

Brad Smith   ( User )

Commented 3 years ago

im still not able to delete from the three dot menu (...) but if i use the bulk delete option it works.

Brad Smith   ( User )

Commented 3 years ago

still cant delete anything just hangs up https://imgur.com/undefined

Brad Smith   ( User )

Commented 2 years ago

still having the same problem anything i try to delete will not delete

Brad Smith   ( User )

Commented 2 years ago

i still cant delete a single item. i must always use the bulk action delete. even if its one item/user/invoice/transaction

Please login or register to leave a response.

Showing 1 to 8 of 8 discussions