MT#63320 /api/vouchers rename to search by base64_code

* the query parameter is now named base64_code to closely
  represent the expected value.
* check and add trailing '=' if it's missing in the provided
  base64_code.

Change-Id: I37c03cd663116d85b5115b5feee1eb6b282596be
(cherry picked from commit b74fbabccc)
(cherry picked from commit cb669386da)
mr12.5.1
Kirill Solomko 5 months ago
parent 923351a67e
commit b8e17ec0f9

@ -46,10 +46,11 @@ sub query_params {
},
},
{
param => 'code',
description => 'Filter for a voucher with the base64 encoded code',
param => 'base64_code',
description => 'Filter for a voucher with the code, the value is expected as an encoded base64 string',
new_rs => sub {
my ($c,$q,$rs) = @_;
my ($c, $q, $rs) = @_;
$q .= '=' unless $q =~ /=$/;
my $code = decode_base64($q);
my $enc_code = NGCP::Panel::Utils::Voucher::encrypt_code($c, $code);
return $rs->search_rs({

Loading…
Cancel
Save