Bugzilla – Attachment 115804 Details for
Bug 26274
Expose cash register cashup summaries via an API route.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 26274: Allow embedding summary
Bug-26274-Allow-embedding-summary.patch (text/plain), 2.38 KB, created by
Martin Renvoize
on 2021-01-26 12:01:22 UTC
(
hide
)
Description:
Bug 26274: Allow embedding summary
Filename:
MIME Type:
Creator:
Martin Renvoize
Created:
2021-01-26 12:01:22 UTC
Size:
2.38 KB
patch
obsolete
>From bb1bf2c92971f7e637b648f332bcce3a862131f9 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Tue, 26 Jan 2021 11:36:25 +0000 >Subject: [PATCH] Bug 26274: Allow embedding summary > >--- > Koha/Cash/Register/Cashup.pm | 6 ++++++ > Koha/REST/V1/CashRegisters/Cashups.pm | 6 +++++- > api/v1/swagger/definitions/cashup.json | 4 ++++ > api/v1/swagger/paths/cash_registers.json | 5 ++++- > 4 files changed, 19 insertions(+), 2 deletions(-) > >diff --git a/Koha/Cash/Register/Cashup.pm b/Koha/Cash/Register/Cashup.pm >index 3732763a4a..025c4c7090 100644 >--- a/Koha/Cash/Register/Cashup.pm >+++ b/Koha/Cash/Register/Cashup.pm >@@ -164,3 +164,9 @@ sub to_api_mapping { > } > > 1; >+ >+=head1 AUTHORS >+ >+Martin Renvoize <martin.renvoize@ptfs-europe.com> >+ >+=cut >diff --git a/Koha/REST/V1/CashRegisters/Cashups.pm b/Koha/REST/V1/CashRegisters/Cashups.pm >index 11ccd302bc..647a1921c0 100644 >--- a/Koha/REST/V1/CashRegisters/Cashups.pm >+++ b/Koha/REST/V1/CashRegisters/Cashups.pm >@@ -65,7 +65,11 @@ sub get { > openapi => { error => "Cashup not found" } ); > } > >- return $c->render( status => 200, openapi => $cashup->to_api ); >+ my $embed = $c->stash('koha.embed'); >+ return $c->render( >+ status => 200, >+ openapi => $cashup->to_api( { embed => $embed } ) >+ ); > } > catch { > $c->unhandled_exception($_); >diff --git a/api/v1/swagger/definitions/cashup.json b/api/v1/swagger/definitions/cashup.json >index ffcaa1c0a8..e643a9c493 100644 >--- a/api/v1/swagger/definitions/cashup.json >+++ b/api/v1/swagger/definitions/cashup.json >@@ -21,6 +21,10 @@ > "type": "string", > "format": "date-time", > "description": "Timestamp for the latest line update" >+ }, >+ "summary": { >+ "type": "object", >+ "description": "A summary of the cashup action" > } > } > } >diff --git a/api/v1/swagger/paths/cash_registers.json b/api/v1/swagger/paths/cash_registers.json >index b730c4afcc..837f1ad35b 100644 >--- a/api/v1/swagger/paths/cash_registers.json >+++ b/api/v1/swagger/paths/cash_registers.json >@@ -95,7 +95,10 @@ > "permissions": { > "cash_management": "cashup" > } >- } >+ }, >+ "x-koha-embed": [ >+ "summary" >+ ] > } > } > } >-- >2.20.1
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 26274
:
115803
|
115804
|
115991
|
115992
|
116136
|
116137
|
116142
|
116143
|
116145
|
116146
|
116174
|
116175
|
116324
|
116325
|
116326
|
116327
|
116939