From ed34041069a5be8fa83109ee934dcd2301a10491 Mon Sep 17 00:00:00 2001 From: Victoria Mihell-Hale Date: Wed, 4 Dec 2024 16:26:38 +0000 Subject: [PATCH] [N/land] Fetch category & group updates from Alloy --- perllib/Open311/UpdatesBase.pm | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/perllib/Open311/UpdatesBase.pm b/perllib/Open311/UpdatesBase.pm index d5bb166408..f62c90e737 100644 --- a/perllib/Open311/UpdatesBase.pm +++ b/perllib/Open311/UpdatesBase.pm @@ -361,6 +361,18 @@ sub _handle_assigned_user { $request->{extras}{detailed_information} ) : $p->unset_extra_metadata('detailed_information'); } + + # Category & group + # TODO Do we want to check that category and group match? + if ( my $category = $request->{extras}{category} ) { + my $contact + = $body->contacts->search( { category => $category } )->first; + $p->category($category) if $contact; + } + + if ( my $group = $request->{extras}{group} ) { + $p->set_extra_metadata( group => $group ); + } } }