This patch updates the stash_embed method to use the parameters hash
enum instead of the top level x-koha-embed custom definition. This way
we can remove the requirement for defining this list twice.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
my $spec = $args->{spec} // {};
- my $embed_spec = $spec->{'x-koha-embed'};
+ my $embed_spec;
+ for my $param (@{$spec->{parameters}}) {
+ next unless $param->{name} eq 'x-koha-embed';
+ $embed_spec = $param->{items}->{enum};
+ }
my $embed_header = $c->req->headers->header('x-koha-embed');
Koha::Exceptions::BadParameter->throw("Embedding objects is not allowed on this endpoint.")