From 7baf02640a95da4d8ae7b0de226d51db08b0e1cb Mon Sep 17 00:00:00 2001 From: bourda_c Date: Mon, 8 Apr 2024 10:04:26 +0200 Subject: [PATCH 1/3] fix typo on get item --- .../request/requests/collections/items/item_request.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/kaze_client/request/requests/collections/items/item_request.rb b/lib/kaze_client/request/requests/collections/items/item_request.rb index a65b442..9071f81 100644 --- a/lib/kaze_client/request/requests/collections/items/item_request.rb +++ b/lib/kaze_client/request/requests/collections/items/item_request.rb @@ -15,7 +15,7 @@ class ItemRequest < Utils::FinalRequest include Utils::AuthentifiedRequest def initialize(collection_id, item_id) - super(:get, "api/collection/#{collection_id}/items/#{item_id}") + super(:get, "api/collections/#{collection_id}/items/#{item_id}") end end From 5f6209fe30bf25d1f93e6ab000716c3bbf762ab5 Mon Sep 17 00:00:00 2001 From: bourda_c Date: Mon, 8 Apr 2024 14:17:51 +0200 Subject: [PATCH 2/3] add LinkedCollectionsRequest --- Gemfile.lock | 1 + .../items/linked_collections_request.rb | 31 +++++++++++++++++++ lib/kaze_client/requests.rb | 1 + 3 files changed, 33 insertions(+) create mode 100644 lib/kaze_client/request/requests/collections/items/linked_collections_request.rb diff --git a/Gemfile.lock b/Gemfile.lock index 29daa6f..8b7ba06 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -85,6 +85,7 @@ GEM PLATFORMS aarch64-linux + arm64-darwin-22 x86_64-darwin-20 DEPENDENCIES diff --git a/lib/kaze_client/request/requests/collections/items/linked_collections_request.rb b/lib/kaze_client/request/requests/collections/items/linked_collections_request.rb new file mode 100644 index 0000000..d18803d --- /dev/null +++ b/lib/kaze_client/request/requests/collections/items/linked_collections_request.rb @@ -0,0 +1,31 @@ +# frozen_string_literal: true + +module KazeClient + + module Collection + + module Item + + class LinkedCollectionsRequest < Utils::FinalRequest + + include Utils::AuthentifiedRequest + include Utils::ListRequest + + # @author bourda_c@modulotech.fr + # Fetch all items linked to a given item + # @see KazeClient::Request + # @see KazeClient::Utils::FinalRequest + # @see KazeClient::Utils::AuthentifiedRequest + # @see KazeClient::Utils::ListRequest + # @since 0.4.0 + def initialize(collection_id, collection_item_id) + super(:get, "api/collections/#{collection_id}/items/#{collection_item_id}/linked_collections") + end + + end + + end + + end + +end diff --git a/lib/kaze_client/requests.rb b/lib/kaze_client/requests.rb index a6ea09c..2b89d14 100644 --- a/lib/kaze_client/requests.rb +++ b/lib/kaze_client/requests.rb @@ -33,6 +33,7 @@ require_relative 'request/requests/collections/items/items_request' require_relative 'request/requests/collections/items/create_link_request' require_relative 'request/requests/collections/items/create_collection_item_request' +require_relative 'request/requests/collections/items/linked_collections_request' # => Tags require_relative 'request/requests/tags/tag_request' From 03cfda1d3d6c17ac597eab26431fba17d3112c19 Mon Sep 17 00:00:00 2001 From: bourda_c Date: Thu, 11 Apr 2024 09:21:15 +0200 Subject: [PATCH 3/3] apply MR review suggestions --- CHANGELOG.md | 2 ++ .../requests/collections/items/linked_collections_request.rb | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ea2e2c7..0188322 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## [Unreleased] +- Add new request: list items linked to a collection. + ## [0.4.0] - 2023-09-12 - Require `AddTagRequest` diff --git a/lib/kaze_client/request/requests/collections/items/linked_collections_request.rb b/lib/kaze_client/request/requests/collections/items/linked_collections_request.rb index d18803d..c8bc857 100644 --- a/lib/kaze_client/request/requests/collections/items/linked_collections_request.rb +++ b/lib/kaze_client/request/requests/collections/items/linked_collections_request.rb @@ -17,7 +17,7 @@ class LinkedCollectionsRequest < Utils::FinalRequest # @see KazeClient::Utils::FinalRequest # @see KazeClient::Utils::AuthentifiedRequest # @see KazeClient::Utils::ListRequest - # @since 0.4.0 + # @since 0.4.1 def initialize(collection_id, collection_item_id) super(:get, "api/collections/#{collection_id}/items/#{collection_item_id}/linked_collections") end