Bugzilla – Attachment 182442 Details for
Bug 39900
Add public REST endpoint for additional_contents
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 39900: Add translated_contents embed
Bug-39900-Add-translatedcontents-embed.patch (text/plain), 2.36 KB, created by
Pedro Amorim
on 2025-05-14 12:41:48 UTC
(
hide
)
Description:
Bug 39900: Add translated_contents embed
Filename:
MIME Type:
Creator:
Pedro Amorim
Created:
2025-05-14 12:41:48 UTC
Size:
2.36 KB
patch
obsolete
>From 80136a0f50eca5a7af841a702ea5097e39416225 Mon Sep 17 00:00:00 2001 >From: Pedro Amorim <pedro.amorim@openfifth.co.uk> >Date: Wed, 14 May 2025 11:25:59 +0000 >Subject: [PATCH] Bug 39900: Add translated_contents embed > >--- > Koha/AdditionalContentsLocalization.pm | 13 +++++++++++++ > api/v1/swagger/definitions/additional_content.yaml | 5 +++++ > api/v1/swagger/paths/additional_contents.yaml | 10 ++++++++++ > 3 files changed, 28 insertions(+) > >diff --git a/Koha/AdditionalContentsLocalization.pm b/Koha/AdditionalContentsLocalization.pm >index 20302f76cab..104fd051431 100644 >--- a/Koha/AdditionalContentsLocalization.pm >+++ b/Koha/AdditionalContentsLocalization.pm >@@ -189,6 +189,19 @@ sub borrowernumber { > return $self->additional_content->borrowernumber(@params); > } > >+=head3 public_read_list >+ >+This method returns the list of publicly readable database fields for both API and UI output purposes >+ >+=cut >+ >+sub public_read_list { >+ return [ >+ 'id', 'additional_content_id', 'title', >+ 'content', 'lang', 'updated_on', >+ ]; >+} >+ > =head2 Class Methods > > =cut >diff --git a/api/v1/swagger/definitions/additional_content.yaml b/api/v1/swagger/definitions/additional_content.yaml >index b440ace5db3..9de4580692c 100644 >--- a/api/v1/swagger/definitions/additional_content.yaml >+++ b/api/v1/swagger/definitions/additional_content.yaml >@@ -35,6 +35,11 @@ properties: > type: > - string > - "null" >+ translated_contents: >+ description: Related additional contents translations >+ type: >+ - array >+ - "null" > required: > - additional_content_id > - category >diff --git a/api/v1/swagger/paths/additional_contents.yaml b/api/v1/swagger/paths/additional_contents.yaml >index 657970cae07..b5a94a3adc7 100644 >--- a/api/v1/swagger/paths/additional_contents.yaml >+++ b/api/v1/swagger/paths/additional_contents.yaml >@@ -35,6 +35,16 @@ > - $ref: "../swagger.yaml#/parameters/per_page" > - $ref: "../swagger.yaml#/parameters/q_param" > - $ref: "../swagger.yaml#/parameters/q_body" >+ - name: x-koha-embed >+ in: header >+ required: false >+ description: Embed list sent as a request header >+ type: array >+ items: >+ type: string >+ enum: >+ - translated_contents >+ collectionFormat: csv > produces: > - application/json > responses: >-- >2.39.5
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 39900
:
182439
|
182440
|
182441
|
182442
|
182443
|
182887
|
182888
|
182889
|
182890
|
182891