Bugzilla – Attachment 155795 Details for
Bug 34333
Add cancellation request information embed option to the holds endpoint
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 34333: Add embed option for `cancellation_requested` for holds
Bug-34333-Add-embed-option-for-cancellationrequest.patch (text/plain), 3.16 KB, created by
Martin Renvoize
on 2023-09-18 10:44:05 UTC
(
hide
)
Description:
Bug 34333: Add embed option for `cancellation_requested` for holds
Filename:
MIME Type:
Creator:
Martin Renvoize
Created:
2023-09-18 10:44:05 UTC
Size:
3.16 KB
patch
obsolete
>From f71d5249597042dd106fce242f4a6482a0dd6c4c Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Thu, 20 Jul 2023 20:18:27 -0300 >Subject: [PATCH] Bug 34333: Add embed option for `cancellation_requested` for > holds > >This patch adds the `cancellation_requested` attribute to the hold >object definition, and allows embeding it as on the different holds >endpoints that migt be useful. > >To test: >1. Apply this patches >2. Run: > $ kshell > k$ prove t/db_dependent/Koha/Hold.t \ > t/db_dependent/api/v1/*holds.t >=> SUCCESS: Tests pass! >3. Play with your REST tool (Postman?) on the following endpoints: > GET http://localhost:8081/api/v1/holds > GET http://localhost:8081/api/v1/patrons/:patron_id/holds >on both, pass and not pass the `x-koha-embed` header with >`cancellation_requested` on it. >=> SUCCESS: It is easy! You see the attribute and you don't, and the >content makes sense! >4. Sign off :-D > >Signed-off-by: David Nind <david@davidnind.com> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > api/v1/swagger/definitions/hold.yaml | 6 ++++++ > api/v1/swagger/paths/holds.yaml | 10 ++++++++++ > api/v1/swagger/paths/patrons_holds.yaml | 10 ++++++++++ > 3 files changed, 26 insertions(+) > >diff --git a/api/v1/swagger/definitions/hold.yaml b/api/v1/swagger/definitions/hold.yaml >index a7d0d393301..f97c3e216b8 100644 >--- a/api/v1/swagger/definitions/hold.yaml >+++ b/api/v1/swagger/definitions/hold.yaml >@@ -103,4 +103,10 @@ properties: > item_level: > type: boolean > description: If the hold is placed at item level >+ cancellation_requested: >+ type: >+ - boolean >+ - "null" >+ description: Cancellation requests count for the hold (x-koha-embed) >+ > additionalProperties: false >diff --git a/api/v1/swagger/paths/holds.yaml b/api/v1/swagger/paths/holds.yaml >index a2143a7dace..7a1055e3915 100644 >--- a/api/v1/swagger/paths/holds.yaml >+++ b/api/v1/swagger/paths/holds.yaml >@@ -88,6 +88,16 @@ > - $ref: "../swagger.yaml#/parameters/q_param" > - $ref: "../swagger.yaml#/parameters/q_body" > - $ref: "../swagger.yaml#/parameters/request_id_header" >+ - name: x-koha-embed >+ in: header >+ required: false >+ description: Embed list sent as a request header >+ type: array >+ items: >+ type: string >+ enum: >+ - cancellation_requested >+ collectionFormat: csv > produces: > - application/json > responses: >diff --git a/api/v1/swagger/paths/patrons_holds.yaml b/api/v1/swagger/paths/patrons_holds.yaml >index ad13a2af5cc..e8e1335a87d 100644 >--- a/api/v1/swagger/paths/patrons_holds.yaml >+++ b/api/v1/swagger/paths/patrons_holds.yaml >@@ -15,6 +15,16 @@ > - $ref: "../swagger.yaml#/parameters/q_param" > - $ref: "../swagger.yaml#/parameters/q_body" > - $ref: "../swagger.yaml#/parameters/request_id_header" >+ - name: x-koha-embed >+ in: header >+ required: false >+ description: Embed list sent as a request header >+ type: array >+ items: >+ type: string >+ enum: >+ - cancellation_requested >+ collectionFormat: csv > produces: > - application/json > responses: >-- >2.41.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 34333
:
153744
|
153745
|
155735
|
155736
|
155794
| 155795