Add notes support to create/update
authorMike Rylander <mrylander@gmail.com>
Fri, 29 May 2020 16:13:09 +0000 (12:13 -0400)
committerMike Rylander <mrylander@gmail.com>
Fri, 29 May 2020 21:16:48 +0000 (17:16 -0400)
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Open-ILS/src/perlmods/lib/OpenILS/Application/Curbside.pm

index 28c03a2..ae11d81 100644 (file)
@@ -495,7 +495,7 @@ __PACKAGE__->register_method(
 );
 
 sub create_update_appointment {
-    my ($self, $conn, $authtoken, $patron, $date, $time, $org) = @_;
+    my ($self, $conn, $authtoken, $patron, $date, $time, $org, $notes) = @_;
     my $mode = 'create';
     $mode = 'update' if ($self->api_name =~ /update/);
 
@@ -601,9 +601,15 @@ sub create_update_appointment {
 
     if (!$slot) { # just in case the hold-ready reactor isn't in place
         $slot = Fieldmapper::action::curbside->new;
+        $slot->isnew(1);
         $slot->patron($patron);
         $slot->org($org);
+        $slot->notes($notes) if ($notes);
         $method = 'create_action_curbside';
+    } else {
+        $slot->notes($notes) if ($notes);
+        $slot->ischanged(1);
+        $method = 'update_action_curbside';
     }
 
     $slot->slot($slot_ts);