From e66a8689ac8c3eaddd77efb18b92eaec8809322d Mon Sep 17 00:00:00 2001 From: Flaviu Mates Date: Tue, 20 Apr 2021 12:53:33 +0300 Subject: [PATCH] TT#119900 Expose slots id in /api/autoattendants Change-Id: I613eca8309cd4f446ca957d6a944cd7e21d87bfb --- lib/NGCP/Panel/Form/Subscriber/AutoAttendantAPI.pm | 5 +++++ lib/NGCP/Panel/Role/API/AutoAttendants.pm | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/NGCP/Panel/Form/Subscriber/AutoAttendantAPI.pm b/lib/NGCP/Panel/Form/Subscriber/AutoAttendantAPI.pm index 43efb7962e..4a69db8ff8 100644 --- a/lib/NGCP/Panel/Form/Subscriber/AutoAttendantAPI.pm +++ b/lib/NGCP/Panel/Form/Subscriber/AutoAttendantAPI.pm @@ -16,6 +16,11 @@ has_field 'slots' => ( }, ); +has_field 'slots.id' => ( + type => '+NGCP::Panel::Field::PosInteger', + readonly => 1, +); + has_field 'slots.slot' => ( type => 'Select', label => 'Key', diff --git a/lib/NGCP/Panel/Role/API/AutoAttendants.pm b/lib/NGCP/Panel/Role/API/AutoAttendants.pm index 5481a72cf5..35f59a23c9 100644 --- a/lib/NGCP/Panel/Role/API/AutoAttendants.pm +++ b/lib/NGCP/Panel/Role/API/AutoAttendants.pm @@ -138,7 +138,7 @@ sub _autoattendants_from_subscriber { my @aas; for my $s ($prov_subscriber->voip_pbx_autoattendants->all) { - push @aas, {destination => $s->destination, slot => $s->choice}; + push @aas, {destination => $s->destination, slot => $s->choice, id => $s->id}; } return \@aas; }