]> git.koha-community.org Git - koha.git/commit
Bug 31797: Add DELETE /items/:item_id endpoint
authorTomas Cohen Arazi <tomascohen@theke.io>
Mon, 26 Dec 2022 19:01:42 +0000 (16:01 -0300)
committerTomas Cohen Arazi <tomascohen@theke.io>
Mon, 30 Jan 2023 15:20:44 +0000 (12:20 -0300)
commitebf7b6471fcf9d622d48cf6e3c1999148c2f113e
tree8648bda063b7818a6ce57c233c08043119ae37ea
parent64d3612dd9c374a18b6aadbd26dc6e7d4be0309a
Bug 31797: Add DELETE /items/:item_id endpoint

This patch adds the mentioned endpoint. The controller relies on
Koha::Item->safe_to_delete for checks and uses `safe_delete` as
additem.pl does.

The required permissions are edit_catalogue.

To test:
1. Apply this patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/api/v1/items.t
=> SUCCESS: Tests pass!
3. Play with item deletion using a REST tool like Postman
=> SUCCESS: All works as expected
4. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Koha/REST/V1/Items.pm
api/v1/swagger/paths/items.yaml
t/db_dependent/api/v1/items.t